is-shared-array-buffer
Advanced tools
Weekly downloads
Changelog
v1.0.2 - 2022-04-01
48d01e6
node/install
instead of node/run
; use codecov
action 7b0e12a
eslint
, @ljharb/eslint-config
, object-inspect
, safe-publish-latest
, tape
8d57a8e
dca4d27
eslint
, @ljharb/eslint-config
, aud
, auto-changelog
, object-inspect
, tape
2a7bb99
eslint
, @ljharb/eslint-config
, auto-changelog
, object-inspect
, safe-publish-latest
, tape
389c6db
b9661f9
eslint
, @ljharb/eslint-config
, aud
, object-inspect
f99cd48
9515ed2
call-bind
dependency cff5358
safe-publish-latest
; use prepublishOnly
script for npm 7+ ba0b719
Readme
Is this value a JS SharedArrayBuffer? This module works cross-realm/iframe, does not depend on instanceof
or mutable properties, and despite ES6 Symbol.toStringTag.
var assert = require('assert');
var isSharedArrayBuffer = require('is-shared-array-buffer');
assert(!isSharedArrayBuffer(function () {}));
assert(!isSharedArrayBuffer(null));
assert(!isSharedArrayBuffer(function* () { yield 42; return Infinity; });
assert(!isSharedArrayBuffer(Symbol('foo')));
assert(!isSharedArrayBuffer(1n));
assert(!isSharedArrayBuffer(Object(1n)));
assert(!isSharedArrayBuffer(new Set()));
assert(!isSharedArrayBuffer(new WeakSet()));
assert(!isSharedArrayBuffer(new Map()));
assert(!isSharedArrayBuffer(new WeakMap()));
assert(!isSharedArrayBuffer(new WeakRef({})));
assert(!isSharedArrayBuffer(new FinalizationRegistry(() => {})));
assert(!isSharedArrayBuffer(new ArrayBuffer()));
assert(isSharedArrayBuffer(new SharedArrayBuffer()));
class MySharedArrayBuffer extends SharedArrayBuffer {}
assert(isSharedArrayBuffer(new MySharedArrayBuffer()));
Simply clone the repo, npm install
, and run npm test
FAQs
Is this value a JS SharedArrayBuffer?
The npm package is-shared-array-buffer receives a total of 19,388,129 weekly downloads. As such, is-shared-array-buffer popularity was classified as popular.
We found that is-shared-array-buffer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.