Skip to content

Commit

Permalink
fix: Update validator to use primoridial
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronccasanova committed Mar 1, 2022
1 parent ecf1fb0 commit e0d0c33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const {
ArrayIsArray,
ArrayPrototypeIncludes,
ArrayPrototypeJoin,
} = require('./primordials');

const {
Expand All @@ -19,7 +20,7 @@ function validateString(value, name) {

function validateUnion(value, name, union) {
if (!ArrayPrototypeIncludes(union, value)) {
throw new ERR_INVALID_ARG_TYPE(name, `('${union.join('|')}')`, value);
throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value);
}
}

Expand Down

0 comments on commit e0d0c33

Please sign in to comment.