We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f568e0 commit 90bc773Copy full SHA for 90bc773
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
@@ -2101,10 +2098,7 @@ function format(...args) {
2101
2098
}
2102
2099
2103
2100
function formatWithOptions(inspectOptions, ...args) {
2104
- if (typeof inspectOptions !== 'object' || inspectOptions === null) {
2105
- throw new ERR_INVALID_ARG_TYPE(
2106
- 'inspectOptions', 'object', inspectOptions);
2107
- }
+ validateObject(inspectOptions, 'inspectOptions', { allowArray: true });
2108
return formatWithOptionsInternal(inspectOptions, args);
2109
2110
0 commit comments