@@ -211,34 +211,34 @@ Object.defineProperty(inspect, 'defaultOptions', {
211211
212212// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
213213inspect . 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 ]
227227} ) ;
228228
229229// Don't use 'blue' not visible on cmd.exe
230230inspect . 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' ,
240240 // "name": intentionally not styling
241- ' regexp' : 'red'
241+ regexp : 'red'
242242} ) ;
243243
244244function addQuotes ( str , quotes ) {
@@ -358,14 +358,10 @@ function getPrefix(constructor, tag, fallback) {
358358 return `[${ fallback } : null prototype] ` ;
359359 }
360360
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 } ] ` ;
366363 }
367-
368- return '' ;
364+ return `${ constructor } ` ;
369365}
370366
371367const getBoxedValue = formatPrimitive . bind ( null , stylizeNoColor ) ;
@@ -619,16 +615,12 @@ function formatRaw(ctx, value, recurseTimes, typedArray) {
619615 braces = [ '{' , '}' ] ;
620616 if ( constructor === 'Object' ) {
621617 if ( isArgumentsObject ( value ) ) {
622- if ( keys . length === 0 )
623- return '[Arguments] {}' ;
624618 braces [ 0 ] = '[Arguments] {' ;
625619 } else if ( tag !== '' ) {
626620 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 ] } }` ;
632624 }
633625 } else if ( typeof value === 'function' ) {
634626 const type = constructor || tag || 'Function' ;
@@ -822,9 +814,7 @@ function handleMaxCallStackSize(ctx, err, constructor, tag, indentationLvl) {
822814
823815function formatNumber ( fn , value ) {
824816 // 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' ) ;
828818}
829819
830820function formatBigInt ( fn , value ) {
0 commit comments