Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inDemoInstall

is-typed-array

Package Overview
Dependencies
5
Maintainers
2
Versions
16
Issues
File Explorer

Advanced tools

is-typed-array

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.

    1.1.10latest
    Github

Version published
Maintainers
2
Weekly downloads
18,747,723
increased by10.86%

Weekly downloads

Changelog

Source

v1.1.10 - 2022-11-02

Commits

  • [meta] add auto-changelog cf6d86b
  • [actions] update rebase action to use reusable workflow 8da51a5
  • [Dev Deps] update aud, is-callable, object-inspect, tape 554e3de
  • [Refactor] use gopd instead of an es-abstract helper [cdaa465`](https://github.com/inspect-js/is-typed-array/commit/cdaa465d5f94bfc9e32475e31209e1c2458a9603)
  • [Deps] update es-abstract 677ae4b
<!-- auto-changelog-above -->

1.1.9 / 2022-05-13

  • [Refactor] use foreach instead of for-each
  • [readme] markdown URL cleanup
  • [Deps] update es-abstract
  • [meta] use npmignore to autogenerate an npmignore file
  • [Dev Deps] update eslint, @ljharb/eslint-config, object-inspect, safe-publish-latest, tape
  • [actions] reuse common workflows
  • [actions] update codecov uploader

1.1.8 / 2021-08-30

  • [Refactor] use globalThis if available (#53)
  • [Deps] update available-typed-arrays
  • [Dev Deps] update @ljharb/eslint-config

1.1.7 / 2021-08-07

  • [Fix] if Symbol.toStringTag exists but is not present, use Object.prototype.toString
  • [Dev Deps] update is-callable, tape

1.1.6 / 2021-08-05

  • [Fix] use has-tostringtag to behave correctly in the presence of symbol shams
  • [readme] add actions and codecov badges
  • [meta] use prepublishOnly script for npm 7+
  • [Deps] update available-typed-arrays, es-abstract
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, object-inspect, tape
  • [actions] use node/install instead of node/run; use codecov action

1.1.5 / 2021-02-14

  • [meta] do not publish github action workflow files or nyc output
  • [Deps] update call-bind, es-abstract
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, is-callable, tape

1.1.4 / 2020-12-05

  • [readme] fix repo URLs, remove defunct badges
  • [Deps] update available-typed-arrays, es-abstract; use call-bind where applicable
  • [meta] gitignore nyc output
  • [meta] only audit prod deps
  • [actions] add "Allow Edits" workflow
  • [actions] switch Automatic Rebase workflow to pull_request_target event
  • [Dev Deps] update eslint, @ljharb/eslint-config, is-callable, make-arrow-function, make-generator-function, object-inspect, tape; add aud
  • [Tests] migrate tests to Github Actions
  • [Tests] run nyc on all tests

1.1.3 / 2020-01-24

  • [Refactor] use es-abstract’s callBound, available-typed-arrays, has-symbols

1.1.2 / 2020-01-20

  • [Fix] in envs without Symbol.toStringTag, dc8a8cc made arrays return true
  • [Tests] add evalmd to prelint

1.1.1 / 2020-01-18

  • [Robustness] don’t rely on Array.prototype.indexOf existing
  • [meta] remove unused Makefile and associated utilities
  • [meta] add funding field; create FUNDING.yml
  • [actions] add automatic rebasing / merge commit blocking
  • [Dev Deps] update eslint, @ljharb/eslint-config, is-callable, replace, semver, tape; add safe-publish-latest
  • [Tests] use shared travis-ci configs
  • [Tests] use npx aud instead of nsp or npm audit with hoops

1.1.0 / 2019-02-16

  • [New] add BigInt64Array and BigUint64Array
  • [Refactor] use an array instead of an object for storing Typed Array names
  • [meta] ignore test.html
  • [Tests] up to node v11.10, v10.15, v8.15, v7.10, v6.16, v5.10, v4.9
  • [Tests] remove jscs
  • [Tests] use npm audit instead of nsp
  • [Dev Deps] update eslint, @ljharb/eslint-config, is-callable, tape, replace, semver
  • [Dev Deps] remove unused eccheck script + dep

1.0.4 / 2016-03-19

  • [Fix] Symbol.toStringTag is on the super-[[Prototype]] of Float32Array, not the [[Prototype]] (#3)
  • [Tests] up to node v5.9, v4.4
  • [Tests] use pretest/posttest for linting/security
  • [Dev Deps] update tape, jscs, nsp, eslint, @ljharb/eslint-config, semver, is-callable

1.0.3 / 2015-10-13

  • [Deps] Add missing foreach dependency (#1)

1.0.2 / 2015-10-05

  • [Deps] Remove unneeded "isarray" dependency
  • [Dev Deps] update eslint, @ljharb/eslint-config

1.0.1 / 2015-10-02

  • Rerelease: avoid instanceof and the constructor property; work cross-realm; work with Symbol.toStringTag.

1.0.0 / 2015-05-06

  • Initial release.

Readme

Source

is-typed-array Version Badge

github actions coverage [![dependency status][5]][6] [![dev dependency status][7]][8] License Downloads

npm badge

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.

Example

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()));

Tests

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

Keywords

FAQs

What is is-typed-array?

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.

Is is-typed-array popular?

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.

Is is-typed-array well maintained?

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.

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[email protected]

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc