3.4.54 • Published 5 months ago

@zitterorg/quod-veritatis v3.4.54

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

@zitterorg/quod-veritatis Version Badge

github actions coverage License Downloads

npm badge

Is this value a JS ArrayBuffer? 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 isArrayBuffer = require('@zitterorg/quod-veritatis');

assert(!isArrayBuffer(function () {}));
assert(!isArrayBuffer(null));
assert(!isArrayBuffer(function* () { yield 42; return Infinity; });
assert(!isArrayBuffer(Symbol('foo')));
assert(!isArrayBuffer(1n));
assert(!isArrayBuffer(Object(1n)));

assert(!isArrayBuffer(new Set()));
assert(!isArrayBuffer(new WeakSet()));
assert(!isArrayBuffer(new Map()));
assert(!isArrayBuffer(new WeakMap()));
assert(!isArrayBuffer(new WeakRef({})));
assert(!isArrayBuffer(new FinalizationRegistry(() => {})));
assert(!isArrayBuffer(new SharedArrayBuffer()));

assert(isArrayBuffer(new ArrayBuffer()));

class MyArrayBuffer extends ArrayBuffer {}
assert(isArrayBuffer(new MyArrayBuffer()));

Tests

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

3.4.54

5 months ago

3.4.51

5 months ago

3.4.52

5 months ago

3.4.53

5 months ago

3.4.47

5 months ago

3.4.48

5 months ago

3.4.49

5 months ago

3.4.50

5 months ago

3.4.44

5 months ago

3.4.45

5 months ago

3.4.46

5 months ago

3.4.41

5 months ago

3.4.42

5 months ago

3.4.43

5 months ago

2.4.41

5 months ago

2.1.18

6 months ago

2.1.19

6 months ago

2.4.39

5 months ago

2.4.36

5 months ago

2.3.24

6 months ago

2.1.23

6 months ago

2.4.35

5 months ago

2.1.24

6 months ago

2.4.38

5 months ago

2.1.21

6 months ago

2.4.37

5 months ago

2.1.22

6 months ago

2.4.32

5 months ago

2.4.31

6 months ago

2.1.20

6 months ago

2.4.34

5 months ago

2.4.33

5 months ago

2.4.30

6 months ago

2.4.29

6 months ago

2.4.28

6 months ago

2.1.17

6 months ago

2.4.25

6 months ago

2.2.24

6 months ago

2.4.24

6 months ago

2.4.27

6 months ago

2.4.26

6 months ago

2.4.40

5 months ago

2.0.17

6 months ago

2.0.16

6 months ago

2.0.15

7 months ago

2.0.13

7 months ago

2.0.14

7 months ago

2.0.11

7 months ago

2.0.12

7 months ago

2.0.9

7 months ago

2.0.10

7 months ago

2.0.8

7 months ago

2.0.7

7 months ago

1.0.7

7 months ago

1.0.6

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