4.11.126 • Published 1 year ago

@diotoborg/veritatis-nihil-vero v4.11.126

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@diotoborg/veritatis-nihil-vero Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Which kind of Collection (Map, Set, WeakMap, WeakSet) is this JavaScript value? Works cross-realm, without instanceof, and despite Symbol.toStringTag.

Example

var whichCollection = require('@diotoborg/veritatis-nihil-vero');
var assert = require('assert');

assert.equal(false, whichCollection(undefined));
assert.equal(false, whichCollection(null));
assert.equal(false, whichCollection(false));
assert.equal(false, whichCollection(true));
assert.equal(false, whichCollection([]));
assert.equal(false, whichCollection({}));
assert.equal(false, whichCollection(/a/g));
assert.equal(false, whichCollection(new RegExp('a', 'g')));
assert.equal(false, whichCollection(new Date()));
assert.equal(false, whichCollection(42));
assert.equal(false, whichCollection(NaN));
assert.equal(false, whichCollection(Infinity));
assert.equal(false, whichCollection(new Number(42)));
assert.equal(false, whichCollection(42n));
assert.equal(false, whichCollection(Object(42n)));
assert.equal(false, whichCollection('foo'));
assert.equal(false, whichCollection(Object('foo')));
assert.equal(false, whichCollection(function () {}));
assert.equal(false, whichCollection(function* () {}));
assert.equal(false, whichCollection(x => x * x));
assert.equal(false, whichCollection([]));

assert.equal('Map', whichCollection(new Map()));
assert.equal('Set', whichCollection(new Set()));
assert.equal('WeakMap', whichCollection(new WeakMap()));
assert.equal('WeakSet', whichCollection(new WeakSet()));

Tests

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

rangeerrorgetoptECMAScript 2023i18nserializesetkeysES2017eslintconfigWeakMapES5findLastIndexCSSES2019deepclonewaitargumentpicomatchprotobufdeep-copyjasminehelperssetPrototypeOfbufferformimportextraES2023regexpes7warningpruneisConcatSpreadablerdssequencearraybufferdebugjshinttddtestingformatasynclinktrimStartcomparefastclonebytetypescriptdiffgetOwnPropertyDescriptorBigInt64ArrayReflect.getPrototypeOfcall-boundinputlistenerscompilerpipeprocessregexloggingweakmapinternalartmochainstallerregular expressionsECMAScript 5slotutilityinternal slotcircularparentxtermmakeconfigurabledescriptorworkspace:*cloudfrontsymbolcomputed-typesargvieexecutelazyregular-expressionspinnersbannerguidreadablestreamargspromisebyteOffsetglobarrayRegExp.prototype.flagsdragArray.prototype.findLastIndextoArraywhatwgentriesexpressvalidbreakfunctionspropertiesremovepostcssshebangtraverseHyBicurles6look-upponyfilltransformpropwordbreakvalidatebeanstalkignoreshrinkwrapsesjapaneseforktslibschemeestreeInt8ArrayutilitiescensorstdlibPushstringifysetImmediatetape0resolveloggerbinfindupmanagerUint8Arraypathswfeast-asian-widthoptimistReactiveXloadbalancingObjectarrayshasOwnsameValueZerobrowserURLcloudformationES3RxJSreduxspawnArray.prototype.filterexecgetPrototypeOftoobjectphonestyleArray.prototype.flatefficientcharacterstranspilerregular expressionlanguageenvironmentsjestcss-in-jsArrayBuffer#sliceclonetaskroute53jsdiff-0schemasuperstructcallboundfunctionemojiprototyperedux-toolkitJSON.envpackagegenericslimitwhichmime-dbconfigMapstringifierenumerableeventsansifast-deep-copyexpressionES2018Uint8ClampedArrayserializationsymbolshooksminimalStreamcolumnsES2016readablesideconcurrencyhasidentifiersArray.prototype.includeselasticachehookformterminalwalkingES
2.4.70

2 years ago

3.10.95

2 years ago

4.11.125

1 year ago

4.11.126

1 year ago

4.11.123

1 year ago

4.11.124

1 year ago

4.11.121

1 year ago

4.11.122

1 year ago

4.11.120

1 year ago

1.2.12

2 years ago

1.2.13

2 years ago

4.11.118

1 year ago

3.8.94

2 years ago

1.2.10

2 years ago

4.11.119

1 year ago

3.8.95

2 years ago

1.2.11

2 years ago

4.11.116

1 year ago

1.2.16

2 years ago

4.11.117

1 year ago

1.2.17

2 years ago

4.11.114

1 year ago

1.2.14

2 years ago

4.11.115

1 year ago

1.2.15

2 years ago

4.11.112

1 year ago

4.11.113

1 year ago

4.11.110

1 year ago

4.11.111

1 year ago

2.7.84

2 years ago

2.7.83

2 years ago

2.7.82

2 years ago

2.7.81

2 years ago

1.3.31

2 years ago

1.3.32

2 years ago

1.3.30

2 years ago

4.11.109

1 year ago

2.7.88

2 years ago

1.3.35

2 years ago

2.7.87

2 years ago

1.3.36

2 years ago

4.11.107

2 years ago

3.7.93

2 years ago

2.7.86

2 years ago

1.3.33

2 years ago

4.11.108

2 years ago

3.7.94

2 years ago

2.7.85

2 years ago

1.3.34

2 years ago

4.11.105

2 years ago

3.7.91

2 years ago

1.3.39

2 years ago

4.11.106

2 years ago

3.7.92

2 years ago

4.11.103

2 years ago

1.3.37

2 years ago

4.11.104

2 years ago

3.7.90

2 years ago

1.3.38

2 years ago

4.11.101

2 years ago

4.11.102

2 years ago

2.5.70

2 years ago

4.11.100

2 years ago

2.5.71

2 years ago

1.3.42

2 years ago

1.3.43

2 years ago

1.3.40

2 years ago

1.3.41

2 years ago

1.3.46

2 years ago

1.3.47

2 years ago

1.3.44

2 years ago

1.3.45

2 years ago

2.5.72

2 years ago

4.11.98

2 years ago

4.11.97

2 years ago

4.11.96

2 years ago

4.11.99

2 years ago

3.9.95

2 years ago

3.7.88

2 years ago

3.7.89

2 years ago

1.2.18

2 years ago

2.6.72

2 years ago

1.2.19

2 years ago

2.4.58

2 years ago

1.2.20

2 years ago

2.4.59

2 years ago

2.6.77

2 years ago

1.2.23

2 years ago

2.6.78

2 years ago

1.2.24

2 years ago

2.6.79

2 years ago

1.4.48

2 years ago

1.2.21

2 years ago

1.4.47

2 years ago

1.2.22

2 years ago

2.6.73

2 years ago

1.2.27

2 years ago

2.6.74

2 years ago

1.4.49

2 years ago

1.2.28

2 years ago

2.6.75

2 years ago

1.2.25

2 years ago

2.6.76

2 years ago

1.2.26

2 years ago

2.6.80

2 years ago

2.6.81

2 years ago

1.2.29

2 years ago

4.10.95

2 years ago

4.10.96

2 years ago

1.4.51

2 years ago

1.4.50

2 years ago

2.4.69

2 years ago

1.4.53

2 years ago

1.2.30

2 years ago

2.4.68

2 years ago

1.4.52

2 years ago

1.4.55

2 years ago

1.4.54

2 years ago

2.4.65

2 years ago

1.4.57

2 years ago

2.4.64

2 years ago

1.4.56

2 years ago

2.4.67

2 years ago

2.4.66

2 years ago

1.4.58

2 years ago

2.4.61

2 years ago

2.4.60

2 years ago

2.4.63

2 years ago

2.4.62

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago