@@ -39,18 +39,18 @@ module.exports = function inspect_ (obj, opts, depth, seen) {
39
39
}
40
40
return String ( obj ) ;
41
41
}
42
- else if ( typeof obj === 'function' ) {
42
+ if ( typeof obj === 'function' ) {
43
43
var name = nameOf ( obj ) ;
44
44
return '[Function' + ( name ? ': ' + name : '' ) + ']' ;
45
45
}
46
- else if ( obj === null ) {
46
+ if ( obj === null ) {
47
47
return 'null' ;
48
48
}
49
- else if ( isSymbol ( obj ) ) {
49
+ if ( isSymbol ( obj ) ) {
50
50
var symString = Symbol . prototype . toString . call ( obj ) ;
51
51
return typeof obj === 'object' ? 'Object(' + symString + ')' : symString ;
52
52
}
53
- else if ( isElement ( obj ) ) {
53
+ if ( isElement ( obj ) ) {
54
54
var s = '<' + String ( obj . nodeName ) . toLowerCase ( ) ;
55
55
var attrs = obj . attributes || [ ] ;
56
56
for ( var i = 0 ; i < attrs . length ; i ++ ) {
@@ -61,15 +61,15 @@ module.exports = function inspect_ (obj, opts, depth, seen) {
61
61
s += '</' + String ( obj . nodeName ) . toLowerCase ( ) + '>' ;
62
62
return s ;
63
63
}
64
- else if ( isArray ( obj ) ) {
64
+ if ( isArray ( obj ) ) {
65
65
if ( obj . length === 0 ) return '[]' ;
66
66
var xs = Array ( obj . length ) ;
67
67
for ( var i = 0 ; i < obj . length ; i ++ ) {
68
68
xs [ i ] = has ( obj , i ) ? inspect ( obj [ i ] , obj ) : '' ;
69
69
}
70
70
return '[ ' + xs . join ( ', ' ) + ' ]' ;
71
71
}
72
- else if ( isError ( obj ) ) {
72
+ if ( isError ( obj ) ) {
73
73
var parts = [ ] ;
74
74
for ( var key in obj ) {
75
75
if ( ! has ( obj , key ) ) continue ;
@@ -84,36 +84,36 @@ module.exports = function inspect_ (obj, opts, depth, seen) {
84
84
if ( parts . length === 0 ) return '[' + String ( obj ) + ']' ;
85
85
return '{ [' + String ( obj ) + '] ' + parts . join ( ', ' ) + ' }' ;
86
86
}
87
- else if ( typeof obj === 'object' && typeof obj . inspect === 'function' ) {
87
+ if ( typeof obj === 'object' && typeof obj . inspect === 'function' ) {
88
88
return obj . inspect ( ) ;
89
89
}
90
- else if ( isMap ( obj ) ) {
90
+ if ( isMap ( obj ) ) {
91
91
var parts = [ ] ;
92
92
mapForEach . call ( obj , function ( value , key ) {
93
93
parts . push ( inspect ( key , obj ) + ' => ' + inspect ( value , obj ) ) ;
94
94
} ) ;
95
95
return 'Map (' + mapSize . call ( obj ) + ') {' + parts . join ( ', ' ) + '}' ;
96
96
}
97
- else if ( isSet ( obj ) ) {
97
+ if ( isSet ( obj ) ) {
98
98
var parts = [ ] ;
99
99
setForEach . call ( obj , function ( value ) {
100
100
parts . push ( inspect ( value , obj ) ) ;
101
101
} ) ;
102
102
return 'Set (' + setSize . call ( obj ) + ') {' + parts . join ( ', ' ) + '}' ;
103
103
}
104
- else if ( typeof obj !== 'object' ) {
104
+ if ( typeof obj !== 'object' ) {
105
105
return String ( obj ) ;
106
106
}
107
- else if ( isNumber ( obj ) ) {
107
+ if ( isNumber ( obj ) ) {
108
108
return 'Object(' + Number ( obj ) + ')' ;
109
109
}
110
- else if ( isBoolean ( obj ) ) {
110
+ if ( isBoolean ( obj ) ) {
111
111
return 'Object(' + booleanValueOf . call ( obj ) + ')' ;
112
112
}
113
- else if ( isString ( obj ) ) {
113
+ if ( isString ( obj ) ) {
114
114
return 'Object(' + inspect ( String ( obj ) ) + ')' ;
115
115
}
116
- else if ( ! isDate ( obj ) && ! isRegExp ( obj ) ) {
116
+ if ( ! isDate ( obj ) && ! isRegExp ( obj ) ) {
117
117
var xs = [ ] , keys = [ ] ;
118
118
for ( var key in obj ) {
119
119
if ( has ( obj , key ) ) keys . push ( key ) ;
@@ -129,7 +129,7 @@ module.exports = function inspect_ (obj, opts, depth, seen) {
129
129
if ( xs . length === 0 ) return '{}' ;
130
130
return '{ ' + xs . join ( ', ' ) + ' }' ;
131
131
}
132
- else return String ( obj ) ;
132
+ return String ( obj ) ;
133
133
} ;
134
134
135
135
function quote ( s ) {
0 commit comments