Skip to content

Commit e0d0c33

Browse files
fix: Update validator to use primoridial
1 parent ecf1fb0 commit e0d0c33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

validators.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const {
44
ArrayIsArray,
55
ArrayPrototypeIncludes,
6+
ArrayPrototypeJoin,
67
} = require('./primordials');
78

89
const {
@@ -19,7 +20,7 @@ function validateString(value, name) {
1920

2021
function validateUnion(value, name, union) {
2122
if (!ArrayPrototypeIncludes(union, value)) {
22-
throw new ERR_INVALID_ARG_TYPE(name, `('${union.join('|')}')`, value);
23+
throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value);
2324
}
2425
}
2526

0 commit comments

Comments
 (0)