@@ -3,17 +3,17 @@ var _ = require('underscore');
33var style = require ( 'ansi-styles' ) ;
44var supportsColor = require ( 'supports-color' ) ;
55
6- var chalk = {
6+ const chalk = {
77 enabled : supportsColor . stdout ,
88 use256 : supportsColor . stdout && supportsColor . stdout . has256 ,
99 themes : { } ,
1010 theme : { }
1111} ;
1212
13- var pres = [ ] ;
14- var posts = [ ] ;
13+ const pres = [ ] ;
14+ const posts = [ ] ;
1515
16- var DEFAULT = {
16+ const DEFAULT = {
1717 black : '#000000' ,
1818 blue : '#0000ff' ,
1919 cyan : '#00ffff' ,
@@ -26,12 +26,12 @@ var DEFAULT = {
2626} ;
2727
2828chalk . setTheme = function ( name ) {
29- var theme = this . themes [ name ] || this . themes . default || { } ;
29+ const theme = this . themes [ name ] || this . themes . default || { } ;
3030 this . theme = _ . extendOwn ( DEFAULT , theme ) ;
3131} ;
3232
3333chalk . sprint = function ( s , hex ) {
34- var color = chalk . use256 ? style . color . ansi256 . hex ( hex ) : style . color . ansi . hex ( hex ) ;
34+ const color = chalk . use256 ? style . color . ansi256 . hex ( hex ) : style . color . ansi . hex ( hex ) ;
3535 return color + s + style . color . close ;
3636} ;
3737
@@ -44,9 +44,7 @@ chalk.print = function(s) {
4444chalk . wrap = function ( pre , post ) {
4545 pres . push ( pre ) ;
4646 posts . unshift ( post ) ;
47- var f = function ( s ) {
48- return chalk . print ( s ) ;
49- } ;
47+ const f = function ( s ) { return chalk . print ( s ) ; } ;
5048 Object . setPrototypeOf ( f , chalk ) ;
5149 return f ;
5250} ;
@@ -55,11 +53,11 @@ function bgName(s) { return 'bg' + s[0].toUpperCase() + s.substr(1); }
5553
5654chalk . init = function ( ) {
5755 require ( './helper' ) . getCodeDirData ( 'colors' ) . forEach ( function ( f ) {
58- var o = { } ;
56+ const o = { } ;
5957 _ . pairs ( f . data ) . forEach ( function ( x ) {
60- var k = x [ 0 ] ;
61- var v = x [ 1 ] ;
62- var bgK = bgName ( k ) ;
58+ const k = x [ 0 ] ;
59+ const v = x [ 1 ] ;
60+ const bgK = bgName ( k ) ;
6361
6462 if ( chalk . use256 ) {
6563 o [ k ] = style . color . ansi256 . hex ( v ) ;
@@ -80,7 +78,7 @@ chalk.init = function() {
8078 } ,
8179 configurable : true
8280 } ) ;
83- var bgcolor = bgName ( color ) ;
81+ const bgcolor = bgName ( color ) ;
8482 Object . defineProperty ( chalk , bgcolor , {
8583 get : function ( ) {
8684 return chalk . wrap ( chalk . theme [ bgcolor ] , style . bgColor . close ) ;
0 commit comments