@@ -211,34 +211,34 @@ Object.defineProperty(inspect, 'defaultOptions', {
211
211
212
212
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
213
213
inspect . colors = Object . assign ( Object . create ( null ) , {
214
- ' bold' : [ 1 , 22 ] ,
215
- ' italic' : [ 3 , 23 ] ,
216
- ' underline' : [ 4 , 24 ] ,
217
- ' inverse' : [ 7 , 27 ] ,
218
- ' white' : [ 37 , 39 ] ,
219
- ' grey' : [ 90 , 39 ] ,
220
- ' black' : [ 30 , 39 ] ,
221
- ' blue' : [ 34 , 39 ] ,
222
- ' cyan' : [ 36 , 39 ] ,
223
- ' green' : [ 32 , 39 ] ,
224
- ' magenta' : [ 35 , 39 ] ,
225
- ' red' : [ 31 , 39 ] ,
226
- ' yellow' : [ 33 , 39 ]
214
+ bold : [ 1 , 22 ] ,
215
+ italic : [ 3 , 23 ] ,
216
+ underline : [ 4 , 24 ] ,
217
+ inverse : [ 7 , 27 ] ,
218
+ white : [ 37 , 39 ] ,
219
+ grey : [ 90 , 39 ] ,
220
+ black : [ 30 , 39 ] ,
221
+ blue : [ 34 , 39 ] ,
222
+ cyan : [ 36 , 39 ] ,
223
+ green : [ 32 , 39 ] ,
224
+ magenta : [ 35 , 39 ] ,
225
+ red : [ 31 , 39 ] ,
226
+ yellow : [ 33 , 39 ]
227
227
} ) ;
228
228
229
229
// Don't use 'blue' not visible on cmd.exe
230
230
inspect . styles = Object . assign ( Object . create ( null ) , {
231
- ' special' : 'cyan' ,
232
- ' number' : 'yellow' ,
233
- ' bigint' : 'yellow' ,
234
- ' boolean' : 'yellow' ,
235
- ' undefined' : 'grey' ,
236
- ' null' : 'bold' ,
237
- ' string' : 'green' ,
238
- ' symbol' : 'green' ,
239
- ' date' : 'magenta' ,
231
+ special : 'cyan' ,
232
+ number : 'yellow' ,
233
+ bigint : 'yellow' ,
234
+ boolean : 'yellow' ,
235
+ undefined : 'grey' ,
236
+ null : 'bold' ,
237
+ string : 'green' ,
238
+ symbol : 'green' ,
239
+ date : 'magenta' ,
240
240
// "name": intentionally not styling
241
- ' regexp' : 'red'
241
+ regexp : 'red'
242
242
} ) ;
243
243
244
244
function addQuotes ( str , quotes ) {
@@ -358,14 +358,10 @@ function getPrefix(constructor, tag, fallback) {
358
358
return `[${ fallback } : null prototype] ` ;
359
359
}
360
360
361
- if ( constructor !== '' ) {
362
- if ( tag !== '' && constructor !== tag ) {
363
- return `${ constructor } [${ tag } ] ` ;
364
- }
365
- return `${ constructor } ` ;
361
+ if ( tag !== '' && constructor !== tag ) {
362
+ return `${ constructor } [${ tag } ] ` ;
366
363
}
367
-
368
- return '' ;
364
+ return `${ constructor } ` ;
369
365
}
370
366
371
367
const getBoxedValue = formatPrimitive . bind ( null , stylizeNoColor ) ;
@@ -619,16 +615,12 @@ function formatRaw(ctx, value, recurseTimes, typedArray) {
619
615
braces = [ '{' , '}' ] ;
620
616
if ( constructor === 'Object' ) {
621
617
if ( isArgumentsObject ( value ) ) {
622
- if ( keys . length === 0 )
623
- return '[Arguments] {}' ;
624
618
braces [ 0 ] = '[Arguments] {' ;
625
619
} else if ( tag !== '' ) {
626
620
braces [ 0 ] = `${ getPrefix ( constructor , tag , 'Object' ) } {` ;
627
- if ( keys . length === 0 ) {
628
- return `${ braces [ 0 ] } }` ;
629
- }
630
- } else if ( keys . length === 0 ) {
631
- return '{}' ;
621
+ }
622
+ if ( keys . length === 0 ) {
623
+ return `${ braces [ 0 ] } }` ;
632
624
}
633
625
} else if ( typeof value === 'function' ) {
634
626
const type = constructor || tag || 'Function' ;
@@ -822,9 +814,7 @@ function handleMaxCallStackSize(ctx, err, constructor, tag, indentationLvl) {
822
814
823
815
function formatNumber ( fn , value ) {
824
816
// Format -0 as '-0'. Checking `value === -0` won't distinguish 0 from -0.
825
- if ( Object . is ( value , - 0 ) )
826
- return fn ( '-0' , 'number' ) ;
827
- return fn ( `${ value } ` , 'number' ) ;
817
+ return fn ( Object . is ( value , - 0 ) ? '-0' : `${ value } ` , 'number' ) ;
828
818
}
829
819
830
820
function formatBigInt ( fn , value ) {
0 commit comments