is-typed-array
Advanced tools
Weekly downloads
Changelog
v1.1.10 - 2022-11-02
auto-changelog
cf6d86b
8da51a5
aud
, is-callable
, object-inspect
, tape
554e3de
gopd
instead of an es-abstract
helper [
cdaa465`](https://github.com/inspect-js/is-typed-array/commit/cdaa465d5f94bfc9e32475e31209e1c2458a9603)es-abstract
677ae4b
foreach
instead of for-each
es-abstract
npmignore
to autogenerate an npmignore fileeslint
, @ljharb/eslint-config
, object-inspect
, safe-publish-latest
, tape
globalThis
if available (#53)available-typed-arrays
@ljharb/eslint-config
is-callable
, tape
has-tostringtag
to behave correctly in the presence of symbol shamsprepublishOnly
script for npm 7+available-typed-arrays
, es-abstract
eslint
, @ljharb/eslint-config
, aud
, object-inspect
, tape
node/install
instead of node/run
; use codecov
actioncall-bind
, es-abstract
eslint
, @ljharb/eslint-config
, aud
, is-callable
, tape
available-typed-arrays
, es-abstract
; use call-bind
where applicablepull_request_target
eventeslint
, @ljharb/eslint-config
, is-callable
, make-arrow-function
, make-generator-function
, object-inspect
, tape
; add aud
nyc
on all testses-abstract
’s callBound
, available-typed-arrays
, has-symbols
true
evalmd
to prelint
funding
field; create FUNDING.ymleslint
, @ljharb/eslint-config
, is-callable
, replace
, semver
, tape
; add safe-publish-latest
npx aud
instead of nsp
or npm audit
with hoopsBigInt64Array
and BigUint64Array
test.html
node
v11.10
, v10.15
, v8.15
, v7.10
, v6.16
, v5.10
, v4.9
jscs
npm audit
instead of nsp
eslint
, @ljharb/eslint-config
, is-callable
, tape
, replace
, semver
Symbol.toStringTag
is on the super-[[Prototype]]
of Float32Array, not the [[Prototype]]
(#3)node
v5.9
, v4.4
tape
, jscs
, nsp
, eslint
, @ljharb/eslint-config
, semver
, is-callable
foreach
dependency (#1)eslint
, @ljharb/eslint-config
Readme
[![dependency status][5]][6]
[![dev dependency status][7]][8]
Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on instanceof
or mutable properties, and despite ES6 Symbol.toStringTag.
var isTypedArray = require('is-typed-array');
var assert = require('assert');
assert.equal(false, isTypedArray(undefined));
assert.equal(false, isTypedArray(null));
assert.equal(false, isTypedArray(false));
assert.equal(false, isTypedArray(true));
assert.equal(false, isTypedArray([]));
assert.equal(false, isTypedArray({}));
assert.equal(false, isTypedArray(/a/g));
assert.equal(false, isTypedArray(new RegExp('a', 'g')));
assert.equal(false, isTypedArray(new Date()));
assert.equal(false, isTypedArray(42));
assert.equal(false, isTypedArray(NaN));
assert.equal(false, isTypedArray(Infinity));
assert.equal(false, isTypedArray(new Number(42)));
assert.equal(false, isTypedArray('foo'));
assert.equal(false, isTypedArray(Object('foo')));
assert.equal(false, isTypedArray(function () {}));
assert.equal(false, isTypedArray(function* () {}));
assert.equal(false, isTypedArray(x => x * x));
assert.equal(false, isTypedArray([]));
assert.ok(isTypedArray(new Int8Array()));
assert.ok(isTypedArray(new Uint8Array()));
assert.ok(isTypedArray(new Uint8ClampedArray()));
assert.ok(isTypedArray(new Int16Array()));
assert.ok(isTypedArray(new Uint16Array()));
assert.ok(isTypedArray(new Int32Array()));
assert.ok(isTypedArray(new Uint32Array()));
assert.ok(isTypedArray(new Float32Array()));
assert.ok(isTypedArray(new Float64Array()));
assert.ok(isTypedArray(new BigInt64Array()));
assert.ok(isTypedArray(new BigUint64Array()));
Simply clone the repo, npm install
, and run npm test
Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and despite ES6 Symbol.toStringTag.
The npm package is-typed-array receives a total of 17,787,804 weekly downloads. As such, is-typed-array popularity was classified as popular.
We found that is-typed-array demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 2 open source maintainers collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.