File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ const DEFAULT = {
2626} ;
2727
2828chalk . setTheme = function ( name ) {
29- const theme = this . themes . get ( name ) || this . themes . get ( 'default' ) || { } ;
30- this . theme = _ . extendOwn ( DEFAULT , theme ) ;
29+ this . theme = this . themes . get ( name ) || this . themes . get ( 'default' ) ;
3130} ;
3231
3332chalk . sprint = function ( s , hex ) {
@@ -55,7 +54,8 @@ chalk.init = function() {
5554 const h = require ( './helper' ) ;
5655 for ( let f of h . getCodeDirData ( 'colors' ) ) {
5756 const theme = { } ;
58- _ . pairs ( f . data ) . forEach ( function ( x ) {
57+ const data = _ . extendOwn ( { } , DEFAULT , f . data ) ;
58+ for ( let x of _ . pairs ( data ) ) {
5959 const k = x [ 0 ] ;
6060 const v = x [ 1 ] ;
6161 const bgK = bgName ( k ) ;
@@ -67,7 +67,7 @@ chalk.init = function() {
6767 theme [ k ] = style . color . ansi . hex ( v ) ;
6868 theme [ bgK ] = style . bgColor . ansi . hex ( v ) ;
6969 }
70- } ) ;
70+ }
7171 chalk . themes . set ( f . name , theme ) ;
7272 }
7373
You can’t perform that action at this time.
0 commit comments