Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

which-typed-array

Package Overview
Dependencies
6
Maintainers
1
Versions
12
Issues
File Explorer

Advanced tools

which-typed-array

Which kind of Typed Array is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.

    1.1.9latest

Version published
Maintainers
1
Weekly downloads
10,429,399
decreased by-8.56%

Weekly downloads

Changelog

Source

v1.1.9 - 2022-11-02

Commits

  • [Dev Deps] update aud, is-callable, tape 9a20b3c
  • [Refactor] use gopd instead of es-abstract helper 00157af
  • [Deps] update is-typed-array 6714240
  • [meta] add sideEffects flag 89b96cc

Readme

Source

which-typed-array Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Which kind of Typed Array is this JavaScript value? Works cross-realm, without instanceof, and despite Symbol.toStringTag.

Example

var whichTypedArray = require('which-typed-array'); var assert = require('assert'); assert.equal(false, whichTypedArray(undefined)); assert.equal(false, whichTypedArray(null)); assert.equal(false, whichTypedArray(false)); assert.equal(false, whichTypedArray(true)); assert.equal(false, whichTypedArray([])); assert.equal(false, whichTypedArray({})); assert.equal(false, whichTypedArray(/a/g)); assert.equal(false, whichTypedArray(new RegExp('a', 'g'))); assert.equal(false, whichTypedArray(new Date())); assert.equal(false, whichTypedArray(42)); assert.equal(false, whichTypedArray(NaN)); assert.equal(false, whichTypedArray(Infinity)); assert.equal(false, whichTypedArray(new Number(42))); assert.equal(false, whichTypedArray('foo')); assert.equal(false, whichTypedArray(Object('foo'))); assert.equal(false, whichTypedArray(function () {})); assert.equal(false, whichTypedArray(function* () {})); assert.equal(false, whichTypedArray(x => x * x)); assert.equal(false, whichTypedArray([])); assert.equal('Int8Array', whichTypedArray(new Int8Array())); assert.equal('Uint8Array', whichTypedArray(new Uint8Array())); assert.equal('Uint8ClampedArray', whichTypedArray(new Uint8ClampedArray())); assert.equal('Int16Array', whichTypedArray(new Int16Array())); assert.equal('Uint16Array', whichTypedArray(new Uint16Array())); assert.equal('Int32Array', whichTypedArray(new Int32Array())); assert.equal('Uint32Array', whichTypedArray(new Uint32Array())); assert.equal('Float32Array', whichTypedArray(new Float32Array())); assert.equal('Float64Array', whichTypedArray(new Float64Array())); assert.equal('BigInt64Array', whichTypedArray(new BigInt64Array())); assert.equal('BigUint64Array', whichTypedArray(new BigUint64Array()));

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

What is which-typed-array?

Which kind of Typed Array is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.

Is which-typed-array popular?

The npm package which-typed-array receives a total of 9,877,682 weekly downloads. As such, which-typed-array popularity was classified as popular.

Is which-typed-array well maintained?

We found that which-typed-array demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 02 Nov 2022

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.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc