|
@ -17,6 +17,8 @@ const inspectDefaultOptions = Object.seal({ |
|
|
breakLength: 60 |
|
|
breakLength: 60 |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const numbersOnlyRE = /^\d+$/; |
|
|
|
|
|
|
|
|
var Debug; |
|
|
var Debug; |
|
|
var simdFormatters; |
|
|
var simdFormatters; |
|
|
|
|
|
|
|
@ -668,7 +670,7 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { |
|
|
output.push(`... ${remaining} more item${remaining > 1 ? 's' : ''}`); |
|
|
output.push(`... ${remaining} more item${remaining > 1 ? 's' : ''}`); |
|
|
} |
|
|
} |
|
|
keys.forEach(function(key) { |
|
|
keys.forEach(function(key) { |
|
|
if (typeof key === 'symbol' || !key.match(/^\d+$/)) { |
|
|
if (typeof key === 'symbol' || !numbersOnlyRE.test(key)) { |
|
|
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, |
|
|
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, |
|
|
key, true)); |
|
|
key, true)); |
|
|
} |
|
|
} |
|
@ -687,7 +689,7 @@ function formatTypedArray(ctx, value, recurseTimes, visibleKeys, keys) { |
|
|
output.push(`... ${remaining} more item${remaining > 1 ? 's' : ''}`); |
|
|
output.push(`... ${remaining} more item${remaining > 1 ? 's' : ''}`); |
|
|
} |
|
|
} |
|
|
for (const key of keys) { |
|
|
for (const key of keys) { |
|
|
if (typeof key === 'symbol' || !key.match(/^\d+$/)) { |
|
|
if (typeof key === 'symbol' || !numbersOnlyRE.test(key)) { |
|
|
output.push( |
|
|
output.push( |
|
|
formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); |
|
|
formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); |
|
|
} |
|
|
} |
|
@ -801,11 +803,11 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (name === undefined) { |
|
|
if (name === undefined) { |
|
|
if (array && key.match(/^\d+$/)) { |
|
|
if (array && numbersOnlyRE.test(key)) { |
|
|
return str; |
|
|
return str; |
|
|
} |
|
|
} |
|
|
name = JSON.stringify('' + key); |
|
|
name = JSON.stringify('' + key); |
|
|
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { |
|
|
if (/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/.test(name)) { |
|
|
name = name.substr(1, name.length - 2); |
|
|
name = name.substr(1, name.length - 2); |
|
|
name = ctx.stylize(name, 'name'); |
|
|
name = ctx.stylize(name, 'name'); |
|
|
} else { |
|
|
} else { |
|
|