1.3.45 • Published 6 months ago

@zitterorg/distinctio-perferendis v1.3.45

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@zitterorg/distinctio-perferendis 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('@zitterorg/distinctio-perferendis');

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

1.4.67

5 months ago

1.4.64

6 months ago

1.4.66

5 months ago

1.4.65

6 months ago

1.4.63

6 months ago

1.4.60

6 months ago

1.4.62

6 months ago

1.4.61

6 months ago

1.4.57

6 months ago

1.4.59

6 months ago

1.4.58

6 months ago

1.4.53

6 months ago

1.4.55

6 months ago

1.4.54

6 months ago

1.4.56

6 months ago

1.2.41

6 months ago

1.2.40

6 months ago

1.2.16

7 months ago

1.2.17

7 months ago

1.2.18

7 months ago

1.2.19

7 months ago

1.2.20

7 months ago

1.4.46

6 months ago

1.2.23

7 months ago

1.2.24

7 months ago

1.4.48

6 months ago

1.2.21

7 months ago

1.4.47

6 months ago

1.2.22

7 months ago

1.2.27

7 months ago

1.4.49

6 months ago

1.2.28

7 months ago

1.2.25

7 months ago

1.2.26

7 months ago

1.2.29

7 months ago

1.4.51

6 months ago

1.4.50

6 months ago

1.3.42

6 months ago

1.2.30

7 months ago

1.4.52

6 months ago

1.3.43

6 months ago

1.2.31

7 months ago

1.3.41

6 months ago

1.3.46

6 months ago

1.2.34

7 months ago

1.2.35

7 months ago

1.3.44

6 months ago

1.2.32

7 months ago

1.3.45

6 months ago

1.2.33

7 months ago

1.2.38

6 months ago

1.2.39

6 months ago

1.2.36

7 months ago

1.2.37

7 months ago

1.2.15

7 months ago

1.1.12

7 months ago

1.2.14

7 months ago

1.1.14

7 months ago

1.1.13

7 months ago

1.1.9

7 months ago

1.1.11

7 months ago

1.1.10

7 months ago

1.1.8

8 months ago

1.1.7

8 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago