File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 16
16
" ansi" ,
17
17
" react"
18
18
],
19
+ "babel" : {
20
+ "presets" : [
21
+ " es2015" ,
22
+ " react"
23
+ ]
24
+ },
19
25
"author" :
" Kyle Kelley <[email protected] >" ,
20
26
"license" : " MPL-2.0" ,
21
27
"dependencies" : {
Original file line number Diff line number Diff line change 1
- 'use strict' ;
1
+ const React = require ( 'react' ) ;
2
2
3
- var React = require ( 'react' ) ;
4
-
5
- var ansiToJSON = require ( 'ansi-to-json' ) ;
3
+ const ansiToJSON = require ( 'ansi-to-json' ) ;
6
4
7
5
function ansiJSONtoStyleBundle ( ansiBundle ) {
8
- var style = { } ;
6
+ const style = { } ;
9
7
if ( ansiBundle . bg ) {
10
- style . backgroundColor = ' rgb(' + ansiBundle . bg + ')' ;
8
+ style . backgroundColor = ` rgb(${ ansiBundle . bg } )` ;
11
9
}
12
10
if ( ansiBundle . fg ) {
13
- style . color = ' rgb(' + ansiBundle . fg + ')' ;
11
+ style . color = ` rgb(${ ansiBundle . fg } )` ;
14
12
}
15
13
return {
16
14
content : ansiBundle . content ,
17
- style : style
15
+ style,
18
16
} ;
19
17
}
20
18
@@ -25,7 +23,7 @@ function ansiToInlineStyle(text) {
25
23
function inlineBundleToReact ( bundle , key ) {
26
24
return React . createElement ( 'span' , {
27
25
style : bundle . style ,
28
- key : key
26
+ key,
29
27
} , bundle . content ) ;
30
28
}
31
29
@@ -37,7 +35,7 @@ function Ansi(props) {
37
35
}
38
36
39
37
Ansi . propTypes = {
40
- children : React . PropTypes . string
38
+ children : React . PropTypes . string ,
41
39
} ;
42
40
43
41
module . exports = Ansi ;
You can’t perform that action at this time.
0 commit comments