5.7.61 • Published 1 year ago

@zitterorg/dolorum-cum v5.7.61

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

@zitterorg/dolorum-cum 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('@zitterorg/dolorum-cum');
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

runtimesyntaxerrorflatisInt8ArraysymlinksArray.prototype.filterbytefetchistanbulprototypecharactershookformmkdirpECMAScript 2015pnpm9ECMAScript 2018command-linetestingUint8ClampedArrayReflect.getPrototypeOfsyntaxES6Float64ArraytrimStartECMAScript 2020positivedeepclone.gitignoreshebangclassesdeterministicserviceiamresolveargvpostcssphonefastifytoolsgloblanguageutilitiesurlvarReactiveExtensionsES2018rm -frString.prototype.matchAllinternalreadstylingglacieres2018searchtraverseenvapprulesstringcommanderbyteLengthsetImmediateparentpoint-freeclass-validatorstylesregular expressionsvisualRegExp.prototype.flagsgitignorekinesisiteratorawesomesaucees2017String.prototype.trimstarterdotenvTypeBoxcoverageform-validationserializerBigUint64ArrayCSSStyleDeclarationtypesomitES8execfileintrinsicArray.prototype.containsTypeScriptES3configObject.entriesstreamslockfileJSON-SchemautilscloudtrailextendsqseventDispatcherfast-clonepolyfillcrypto3dbddnamelocalroute53draglook-upvalidairbnbstringifysettingscompareTypedArraylintroutingcomputed-typesthreepipereacterrordirreworkqueryvarsemojivalidationargumentartutilityspectoStringTagreducerRx$.extenddeletegetintrinsiceslintpluginfpsyupgraphqles-shimsrequireflag[[Prototype]]effect-tspackagesArraytransformtypescriptlistenerswaapibuffercolorsemitxhrenvironment@@toStringTagtelephonetrimequalinstallerbrowserlisttransportECMAScript 3fixed-widthreducetrimEndtypeAsyncIteratorcssrfc4122call-boundfptoolkitbindguiduuidbyteOffsetjson-schemaquotetyped arraygesturesaccessibilitysortedes8ECMAScript 2017dynamodbassertsfilezerocloudformationl10nramdaeventscolumnstypedcallbackeventEmitter.envmanipulationECMAScript 2022elbarraybufferstringifierindicatorflattenreversedfindrmdirkeyssideoffsetuninstalldeepcopyconcatmodulesclassnameoptimizerES7Array.prototype.flatargsecmascriptes7karmaRFC-6455movecreateUnderscoreregexpdoms3ECMAScript 2023routerfullwidthoutputhttpsprogressutil.inspectcall-bindfnmatchRxJSexpressionnamescjknumberansiwaftranspilerUint32Arraybundlingmapdayjses2015parsetermidlefindLastIndexbusysettercensorbinariesgetoptfastcopysharedarraybufferterminalwidthsymbolsrangeerrorwebpureStreamarraycircularlengthSetcompilereveryi18nclassnamessnsObject.assignes6debugworkerminimalfunctionalanimationtslibhtmlec2ES2019queuesinatrastreamtypaniondataViewwalkingjest
5.7.61

1 year ago

5.7.60

1 year ago

5.7.59

1 year ago

5.7.58

1 year ago

5.7.57

1 year ago

5.7.54

1 year ago

5.7.56

1 year ago

5.7.55

1 year ago

4.7.52

1 year ago

4.7.53

1 year ago

4.7.54

1 year ago

4.7.50

1 year ago

4.7.51

1 year ago

4.7.49

1 year ago

4.7.48

1 year ago

2.2.18

1 year ago

4.4.25

1 year ago

4.4.24

1 year ago

4.4.23

1 year ago

4.4.27

1 year ago

4.4.26

1 year ago

4.7.41

1 year ago

4.7.42

1 year ago

4.6.30

1 year ago

4.7.40

1 year ago

4.7.45

1 year ago

4.7.46

1 year ago

2.1.17

1 year ago

4.7.43

1 year ago

4.6.31

1 year ago

4.7.44

1 year ago

4.7.47

1 year ago

4.5.27

1 year ago

3.3.19

1 year ago

4.7.31

1 year ago

3.4.23

1 year ago

2.1.18

1 year ago

4.7.34

1 year ago

4.7.35

1 year ago

4.7.32

1 year ago

4.7.33

1 year ago

4.7.38

1 year ago

4.7.39

1 year ago

4.6.27

1 year ago

4.7.36

1 year ago

4.7.37

1 year ago

4.6.28

1 year ago

4.6.29

1 year ago

3.3.20

1 year ago

3.3.21

1 year ago

3.3.22

1 year ago

3.3.23

1 year ago

2.3.19

1 year ago

2.3.18

1 year ago

2.1.16

1 year ago

2.0.15

1 year ago

2.0.16

1 year ago

2.0.13

1 year ago

2.0.14

1 year ago

2.0.11

1 year ago

2.0.12

1 year ago

2.0.10

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago