Skip to content

Commit 94771f7

Browse files
committed
ES5ify our non-transpiled package
1 parent a5de7d6 commit 94771f7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

index.js

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

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

57
function ansiJSONtoStyleBundle(ansiBundle) {
6-
const style = {};
8+
var style = {};
79
if (ansiBundle.bg) {
8-
style.backgroundColor = `rgb(${ansiBundle.bg})`;
10+
style.backgroundColor = 'rgb(' + ansiBundle.bg + ')';
911
}
1012
if (ansiBundle.fg) {
11-
style.color = `rgb(${ansiBundle.fg})`;
13+
style.color = 'rgb(' + ansiBundle.fg + ')';
1214
}
1315
return {
1416
content: ansiBundle.content,
15-
style,
17+
style: style
1618
};
1719
}
1820

@@ -23,7 +25,7 @@ function ansiToInlineStyle(text) {
2325
function inlineBundleToReact(bundle, key) {
2426
return React.createElement('span', {
2527
style: bundle.style,
26-
key,
28+
key: key
2729
}, bundle.content);
2830
}
2931

@@ -35,7 +37,7 @@ function Ansi(props) {
3537
}
3638

3739
Ansi.propTypes = {
38-
children: React.PropTypes.string,
40+
children: React.PropTypes.string
3941
};
4042

4143
module.exports = Ansi;

0 commit comments

Comments
 (0)