1.4.67 • Published 5 months ago

@zitterorg/distinctio-perferendis v1.4.67

Weekly downloads
-
License
MIT
Repository
github
Last release
5 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

5 months ago

1.4.66

5 months ago

1.4.65

5 months ago

1.4.63

5 months ago

1.4.60

5 months ago

1.4.62

5 months ago

1.4.61

5 months ago

1.4.57

5 months ago

1.4.59

5 months ago

1.4.58

5 months ago

1.4.53

5 months ago

1.4.55

5 months ago

1.4.54

5 months ago

1.4.56

5 months ago

1.2.41

6 months ago

1.2.40

6 months ago

1.2.16

6 months ago

1.2.17

6 months ago

1.2.18

6 months ago

1.2.19

6 months ago

1.2.20

6 months ago

1.4.46

5 months ago

1.2.23

6 months ago

1.2.24

6 months ago

1.4.48

5 months ago

1.2.21

6 months ago

1.4.47

5 months ago

1.2.22

6 months ago

1.2.27

6 months ago

1.4.49

5 months ago

1.2.28

6 months ago

1.2.25

6 months ago

1.2.26

6 months ago

1.2.29

6 months ago

1.4.51

5 months ago

1.4.50

5 months ago

1.3.42

6 months ago

1.2.30

6 months ago

1.4.52

5 months ago

1.3.43

6 months ago

1.2.31

6 months ago

1.3.41

6 months ago

1.3.46

5 months ago

1.2.34

6 months ago

1.2.35

6 months ago

1.3.44

6 months ago

1.2.32

6 months ago

1.3.45

5 months ago

1.2.33

6 months ago

1.2.38

6 months ago

1.2.39

6 months ago

1.2.36

6 months ago

1.2.37

6 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

7 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago