We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3515fae commit ecd584bCopy full SHA for ecd584b
lib/internal/util/inspect.js
@@ -104,9 +104,6 @@ const {
104
} = require('internal/util');
105
106
const {
107
- codes: {
108
- ERR_INVALID_ARG_TYPE
109
- },
110
isStackOverflowError
111
} = require('internal/errors');
112
@@ -2099,10 +2096,7 @@ function format(...args) {
2099
2096
}
2100
2097
2101
2098
function formatWithOptions(inspectOptions, ...args) {
2102
- if (typeof inspectOptions !== 'object' || inspectOptions === null) {
2103
- throw new ERR_INVALID_ARG_TYPE(
2104
- 'inspectOptions', 'object', inspectOptions);
2105
- }
+ validateObject(inspectOptions, 'inspectOptions', { allowArray: true });
2106
return formatWithOptionsInternal(inspectOptions, args);
2107
2108
0 commit comments