diff options
author | cjihrig <cjihrig@gmail.com> | 2019-08-17 11:50:43 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-08-19 11:55:22 -0400 |
commit | 3238232fc46f6a8cc0dc1323aba762247c464e5e (patch) | |
tree | 428f6636855f08a5224204c319ec2d2f89ee4ae4 /lib/internal/validators.js | |
parent | 37321a9e11f2198d03a525cddca20827636b786c (diff) | |
download | android-node-v8-3238232fc46f6a8cc0dc1323aba762247c464e5e.tar.gz android-node-v8-3238232fc46f6a8cc0dc1323aba762247c464e5e.tar.bz2 android-node-v8-3238232fc46f6a8cc0dc1323aba762247c464e5e.zip |
lib: rename validateSafeInteger to validateInteger
validateInteger() was renamed to validateSafeInteger() in
https://github.com/nodejs/node/pull/26572. However, this
function also works with unsafe integers. This commit restores
the old name, and adds some basic tests.
PR-URL: https://github.com/nodejs/node/pull/29184
Refs: https://github.com/nodejs/node/pull/26572
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'lib/internal/validators.js')
-rw-r--r-- | lib/internal/validators.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/internal/validators.js b/lib/internal/validators.js index 88d1d0a42c..f74338ebcb 100644 --- a/lib/internal/validators.js +++ b/lib/internal/validators.js @@ -62,7 +62,7 @@ function parseMode(value, name, def) { throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc); } -const validateSafeInteger = hideStackFrames( +const validateInteger = hideStackFrames( (value, name, min = MIN_SAFE_INTEGER, max = MAX_SAFE_INTEGER) => { if (typeof value !== 'number') throw new ERR_INVALID_ARG_TYPE(name, 'number', value); @@ -161,7 +161,7 @@ module.exports = { parseMode, validateBuffer, validateEncoding, - validateSafeInteger, + validateInteger, validateInt32, validateUint32, validateString, |