@@ -44,12 +44,12 @@ chalk.print = function(s) {
4444chalk . wrap = function ( pre , post ) {
4545 pres . push ( pre ) ;
4646 posts . unshift ( post ) ;
47- const f = function ( s ) { return chalk . print ( s ) ; } ;
47+ const f = x => chalk . print ( x ) ;
4848 Object . setPrototypeOf ( f , chalk ) ;
4949 return f ;
5050} ;
5151
52- function bgName ( s ) { return 'bg' + s [ 0 ] . toUpperCase ( ) + s . substr ( 1 ) ; }
52+ const bgName = x => 'bg' + x [ 0 ] . toUpperCase ( ) + x . substr ( 1 ) ;
5353
5454chalk . init = function ( ) {
5555 require ( './helper' ) . getCodeDirData ( 'colors' ) . forEach ( function ( f ) {
@@ -73,26 +73,20 @@ chalk.init = function() {
7373 _ . chain ( [ 'black' , 'blue' , 'cyan' , 'gray' , 'green' , 'magenta' , 'red' , 'white' , 'yellow' ] )
7474 . each ( function ( color ) {
7575 Object . defineProperty ( chalk , color , {
76- get : function ( ) {
77- return chalk . wrap ( chalk . theme [ color ] , style . color . close ) ;
78- } ,
76+ get : ( ) => chalk . wrap ( chalk . theme [ color ] , style . color . close ) ,
7977 configurable : true
8078 } ) ;
8179 const bgcolor = bgName ( color ) ;
8280 Object . defineProperty ( chalk , bgcolor , {
83- get : function ( ) {
84- return chalk . wrap ( chalk . theme [ bgcolor ] , style . bgColor . close ) ;
85- } ,
81+ get : ( ) => chalk . wrap ( chalk . theme [ bgcolor ] , style . bgColor . close ) ,
8682 configurable : true
8783 } ) ;
8884 } ) ;
8985
9086 _ . chain ( [ 'bold' , 'dim' , 'italic' , 'inverse' , 'strikethrough' , 'underline' ] )
9187 . each ( function ( modifier ) {
9288 Object . defineProperty ( chalk , modifier , {
93- get : function ( ) {
94- return chalk . wrap ( style [ modifier ] . open , style [ modifier ] . close ) ;
95- } ,
89+ get : ( ) => chalk . wrap ( style [ modifier ] . open , style [ modifier ] . close ) ,
9690 configurable : true
9791 } ) ;
9892 } ) ;
0 commit comments