1.2.9 • Published 6 days ago

@diotoborg/veritatis-nihil-vero v1.2.9

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

6 days ago

1.2.8

7 days ago

1.2.7

8 days ago

1.2.6

9 days ago

1.2.5

10 days ago

1.2.4

11 days ago

1.2.3

12 days ago

1.2.2

13 days ago

1.1.2

14 days ago

1.1.1

15 days ago

1.0.1

16 days ago

1.0.0

16 days ago