Socket
Socket
Sign inDemoInstall

is-shared-array-buffer

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-shared-array-buffer


Version published
Maintainers
1
Created

Changelog

Source

v1.0.3 - 2024-02-20

Commits

  • [meta] use npmignore to autogenerate an npmignore file c4131f5
  • add types 41cb419
  • [actions] skip ls check on node < 10; remove redundant finisher 2655b01
  • [Dev Deps] update @ljharb/eslint-config, aud, available-typed-arrays, npmignore, object-inspect, tape 5917f9a
  • [Tests] add tests that TypedArrays are not SABs 823dd7a
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, es-value-fixtures, object-inspect, tape 6701ad4
  • [actions] update rebase action to use reusable workflow b5119f0
  • [Dev Deps] update @ljharb/eslint-config, aud 38a6d72
  • [meta] add missing engines.node aac97e1
  • [readme] remove dead badges 07c452d
  • [Deps] update call-bind b8576fe
  • [meta] add sideEffects flag 3e6730e

Readme

Source

is-shared-array-buffer Version Badge

github actions coverage License Downloads

npm badge

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.

Example

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

Tests

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

Keywords

FAQs

Last updated on 21 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc