Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f32aec8

Browse filesBrowse files
cola119danielleadams
authored andcommitted
util: refactor to use validateObject
PR-URL: #43769 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
1 parent 8432d65 commit f32aec8
Copy full SHA for f32aec8

File tree

Expand file treeCollapse file tree

1 file changed

+1
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-7
lines changed
Open diff view settings
Collapse file

‎lib/internal/util/inspect.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ const {
104104
} = require('internal/util');
105105

106106
const {
107-
codes: {
108-
ERR_INVALID_ARG_TYPE
109-
},
110107
isStackOverflowError
111108
} = require('internal/errors');
112109

@@ -2101,10 +2098,7 @@ function format(...args) {
21012098
}
21022099

21032100
function formatWithOptions(inspectOptions, ...args) {
2104-
if (typeof inspectOptions !== 'object' || inspectOptions === null) {
2105-
throw new ERR_INVALID_ARG_TYPE(
2106-
'inspectOptions', 'object', inspectOptions);
2107-
}
2101+
validateObject(inspectOptions, 'inspectOptions', { allowArray: true });
21082102
return formatWithOptionsInternal(inspectOptions, args);
21092103
}
21102104

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.