Skip to content

Commit

Permalink
validators: add validateUndefined
Browse files Browse the repository at this point in the history
Added the `validateUndefined()` method.
  • Loading branch information
VoltrexKeyva authored Jun 18, 2021
1 parent 8d1c38b commit 324b78e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/internal/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ const validateFunction = hideStackFrames((value, name) => {
throw new ERR_INVALID_ARG_TYPE(name, 'Function', value);
});

const validateUndefined = hideStackFrames((value, name) => {
if (value !== undefined)
throw new ERR_INVALID_ARG_TYPE(name, 'undefined', value);
});

module.exports = {
isInt32,
isUint32,
Expand All @@ -247,6 +252,7 @@ module.exports = {
validateSignalName,
validateString,
validateUint32,
validateUndefined,
validateCallback,
validateAbortSignal,
};

0 comments on commit 324b78e

Please sign in to comment.