5.7.61 • Published 2 years ago

@zitterorg/dolorum-cum v5.7.61

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

2 years ago

5.7.60

2 years ago

5.7.59

2 years ago

5.7.58

2 years ago

5.7.57

2 years ago

5.7.54

2 years ago

5.7.56

2 years ago

5.7.55

2 years ago

4.7.52

2 years ago

4.7.53

2 years ago

4.7.54

2 years ago

4.7.50

2 years ago

4.7.51

2 years ago

4.7.49

2 years ago

4.7.48

2 years ago

2.2.18

2 years ago

4.4.25

2 years ago

4.4.24

2 years ago

4.4.23

2 years ago

4.4.27

2 years ago

4.4.26

2 years ago

4.7.41

2 years ago

4.7.42

2 years ago

4.6.30

2 years ago

4.7.40

2 years ago

4.7.45

2 years ago

4.7.46

2 years ago

2.1.17

2 years ago

4.7.43

2 years ago

4.6.31

2 years ago

4.7.44

2 years ago

4.7.47

2 years ago

4.5.27

2 years ago

3.3.19

2 years ago

4.7.31

2 years ago

3.4.23

2 years ago

2.1.18

2 years ago

4.7.34

2 years ago

4.7.35

2 years ago

4.7.32

2 years ago

4.7.33

2 years ago

4.7.38

2 years ago

4.7.39

2 years ago

4.6.27

2 years ago

4.7.36

2 years ago

4.7.37

2 years ago

4.6.28

2 years ago

4.6.29

2 years ago

3.3.20

2 years ago

3.3.21

2 years ago

3.3.22

2 years ago

3.3.23

2 years ago

2.3.19

2 years ago

2.3.18

2 years ago

2.1.16

2 years ago

2.0.15

2 years ago

2.0.16

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.10

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago