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 77cb604

Browse filesBrowse files
VoltrexKeyvadanielleadams
authored andcommitted
process: use validateString validator
Use the `validateString()` validator where applicable. PR-URL: #41595 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 7ee3cdf commit 77cb604
Copy full SHA for 77cb604

File tree

Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Open diff view settings
Collapse file

‎lib/internal/process/report.js‎

Copy file name to clipboardExpand all lines: lib/internal/process/report.js
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
const {
3-
ERR_INVALID_ARG_TYPE,
43
ERR_SYNTHETIC
54
} = require('internal/errors').codes;
65
const {
@@ -18,9 +17,11 @@ const report = {
1817
if (typeof file === 'object' && file !== null) {
1918
err = file;
2019
file = undefined;
21-
} else if (file !== undefined && typeof file !== 'string') {
22-
throw new ERR_INVALID_ARG_TYPE('file', 'String', file);
23-
} else if (err === undefined) {
20+
} else if (file !== undefined) {
21+
validateString(file, 'file');
22+
}
23+
24+
if (err === undefined) {
2425
err = new ERR_SYNTHETIC();
2526
} else {
2627
validateObject(err, 'err');

0 commit comments

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