Skip to content

Commit 8083b3d

Browse files
committed
Switch to transpiled.
1 parent efc3f81 commit 8083b3d

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"ansi",
1717
"react"
1818
],
19+
"babel": {
20+
"presets": [
21+
"es2015",
22+
"react"
23+
]
24+
},
1925
"author": "Kyle Kelley <[email protected]>",
2026
"license": "MPL-2.0",
2127
"dependencies": {

src/index.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
'use strict';
1+
const React = require('react');
22

3-
var React = require('react');
4-
5-
var ansiToJSON = require('ansi-to-json');
3+
const ansiToJSON = require('ansi-to-json');
64

75
function ansiJSONtoStyleBundle(ansiBundle) {
8-
var style = {};
6+
const style = {};
97
if (ansiBundle.bg) {
10-
style.backgroundColor = 'rgb(' + ansiBundle.bg + ')';
8+
style.backgroundColor = `rgb(${ansiBundle.bg})`;
119
}
1210
if (ansiBundle.fg) {
13-
style.color = 'rgb(' + ansiBundle.fg + ')';
11+
style.color = `rgb(${ansiBundle.fg})`;
1412
}
1513
return {
1614
content: ansiBundle.content,
17-
style: style
15+
style,
1816
};
1917
}
2018

@@ -25,7 +23,7 @@ function ansiToInlineStyle(text) {
2523
function inlineBundleToReact(bundle, key) {
2624
return React.createElement('span', {
2725
style: bundle.style,
28-
key: key
26+
key,
2927
}, bundle.content);
3028
}
3129

@@ -37,7 +35,7 @@ function Ansi(props) {
3735
}
3836

3937
Ansi.propTypes = {
40-
children: React.PropTypes.string
38+
children: React.PropTypes.string,
4139
};
4240

4341
module.exports = Ansi;

0 commit comments

Comments
 (0)