diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2018-03-07 17:05:01 +0100 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-04-11 13:23:35 -0400 |
commit | 01c9575ad5fbe7e5acce3539d9c6d6df66bfe4b5 (patch) | |
tree | a8c98c07b52a0d0e22be321ea7560199365e3363 /lib | |
parent | 24ec79627da6d4eea18ac51930d98bd2af65c3b9 (diff) | |
download | android-node-v8-01c9575ad5fbe7e5acce3539d9c6d6df66bfe4b5.tar.gz android-node-v8-01c9575ad5fbe7e5acce3539d9c6d6df66bfe4b5.tar.bz2 android-node-v8-01c9575ad5fbe7e5acce3539d9c6d6df66bfe4b5.zip |
util: add type check functions for BigInt arrays
Adds `isBigInt64Array` and `isBigUint64Array`.
PR-URL: https://github.com/nodejs/node/pull/19201
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/util/types.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/internal/util/types.js b/lib/internal/util/types.js index 4df62554d1..182625a971 100644 --- a/lib/internal/util/types.js +++ b/lib/internal/util/types.js @@ -61,6 +61,14 @@ function isFloat64Array(value) { return TypedArrayProto_toStringTag(value) === 'Float64Array'; } +function isBigInt64Array(value) { + return TypedArrayProto_toStringTag(value) === 'BigInt64Array'; +} + +function isBigUint64Array(value) { + return TypedArrayProto_toStringTag(value) === 'BigUint64Array'; +} + module.exports = { isArrayBufferView, isTypedArray, @@ -72,5 +80,7 @@ module.exports = { isInt16Array, isInt32Array, isFloat32Array, - isFloat64Array + isFloat64Array, + isBigInt64Array, + isBigUint64Array }; |