swc/bundler/tests/.cache/deno/81bebc1ecbb5f0562022195fec7cd337dac9f4bc.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

27 lines
1.0 KiB
TypeScript

// Loaded from https://deno.land/x/ramda@v0.27.2/source/internal/_isTypedArray.js
/**
* Tests whether or not an object is a typed array.
*
* @private
* @param {*} val The object to test.
* @return {Boolean} `true` if `val` is a typed array, `false` otherwise.
* @example
*
* _isTypedArray(new Uint8Array([])); //=> true
* _isTypedArray(new Float32Array([])); //=> true
* _isTypedArray([]); //=> false
* _isTypedArray(null); //=> false
* _isTypedArray({}); //=> false
*/
export default function _isTypedArray(val) {
var type = Object.prototype.toString.call(val);
return type === '[object Uint8ClampedArray]' ||
type === '[object Int8Array]' || type === '[object Uint8Array]' ||
type === '[object Int16Array]' || type === '[object Uint16Array]' ||
type === '[object Int32Array]' || type === '[object Uint32Array]' ||
type === '[object Float32Array]' || type === '[object Float64Array]' ||
type === '[object BigInt64Array]' || type === '[object BigUint64Array]';
}