2.10.70 • Published 2 years ago

@hishprorg/quod-veritatis v2.10.70

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@hishprorg/quod-veritatis 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('@hishprorg/quod-veritatis');
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

TypedArrayhelperscommand-linetranspilerfunctionalfigletglobalslengthObject.isjson-schema-validatorconsumeObject.definePropertyjsonschemaeventEmitterbabel-corees-shimschineselistenersMapparseUint8ClampedArraytypedroute53ramdaECMAScript 2021classnameshardlinkscolorSystem.globalESdeletetraverseparseroptionformslastttyassertimportexportprotocol-buffersschemevarsrangeerrorenvironmentESnextflattenpackagesArrayBufferexecfilecallboundglobremovecryptUnderscorewindowsArrayBuffer.prototype.slicestyleguidemovechromiumpackage.jsonrulesmake dirtscheckfindLastIndexworkspace:*queueMicrotaskeffect-tses2016compile lessprefixWebSocketsefficientES2019callbindwarningtextObject.getPrototypeOfutilsasciimodulees-shim APIsesObject.fromEntriesObject.assigncallbackexitjson-schema-validationenumerabletypedarrayshasOwnPropertystringifynested csstoSortedispostcss-pluginPromiseeventsObservablessyntaxArrayonceemitsliceArray.prototype.flatMapvalidatorhotbyteLengthmapslotpopmotiones7typesafevpccachemonorepocoercibleloggereslintconfigcloudformationelbsortedglobalzerovalidateforkpersistentargvmulti-packageautoprefixer$.extendreact-hooksdiffendpointargsajvignorematchAllarraybufferhandlersnodejsoperating-systempostcssielazyrequirebyteOffsetwgetstarterReactiveXendercreateshrinkwrapreplayequalitytranspilecloudwatchassertionkeysnpmignoresetterbuffersfastifyspringreadablestreamwafgroupreusecsseslint-pluginchildfast-deep-cloneredux-toolkitbootstrap lessgraphqlposemruWebSocketfull__proto__computed-typesharmonycharacterdependenciescloudtraildescriptorsserializebundlingflagsawszoddatastructurefetchbannerES2022handlerpnpm9promisefastelasticacheRxJSArray.prototype.flattenes-abstractpatches5es2018classnamegetPrototypeOfURLmomentirqvaluesxtermtrimEndhttpcloudsearchtrimLeftlrujsxtestingutileslintpluginclonepruneclassesback-endquerystringcryptoECMAScript 2015linuxkoreaniamreadless cssuploadcolourFunction.prototype.namematchprotoflagsetPrototypeOfpluginstateinstallconfigurableloadbalancingtoolkitexecuteintrinsicES6mkdirutilitiesinspectbundlersnsdefinePropertybusyextrapreserve-symlinksObservableperformancewritepureObject.entriesmergeECMAScript 3CSSStyleDeclarationinvariantindicatorimportprivate datafunctionjsonsafestatelessarktypeproxyES7japanese3dsameValueZeropropertiesspeedgenericsreduxauthperformantES2023RegExp.prototype.flagsgitignoremanagerCSSbinaryArray.prototype.includesgroupByarrayszxECMAScript 2017react animationaccessibilityreact-testing-librarydeep-clonefast-copyECMAScriptenvironmentsglobal this valueglobal objectserverpushquerylesschannelreact-hook-formes6dayjsless.jstostringtagjestES3routingInt32ArraydateidlenamesterminalairbnbtypelockfilepasswordredirectpredictableruntimewaapirobustthreeownentriesoptimisttypanionFloat32Arrayprototypeassignhttpsconsolenativedom-testing-libraryes8RFC-6455fast-cloneString.prototype.trimgradients cssreducestylesheetWeakMapfromkeyclass-validatorasterisksbootstrap cssdescriptorbddmacosweaksetastdataViewoutputlanguagecss lesslogiterationnopepicomatchcoretypedarrayio-tsstructuredCloneimmerbytechromecomparemapreducestyled-components
2.10.70

2 years ago

2.10.69

2 years ago

2.10.68

2 years ago

2.9.68

2 years ago

2.9.67

2 years ago

2.9.66

2 years ago

2.9.65

2 years ago

2.9.64

2 years ago

2.9.63

2 years ago

2.9.62

2 years ago

2.9.61

2 years ago

2.9.60

2 years ago

2.9.59

2 years ago

2.9.58

2 years ago

2.9.57

2 years ago

2.9.56

2 years ago

2.8.56

2 years ago

2.7.56

2 years ago

2.7.55

2 years ago

2.7.54

2 years ago

2.7.53

2 years ago

2.7.52

2 years ago

2.7.51

2 years ago

2.7.50

2 years ago

2.7.49

2 years ago

2.7.48

2 years ago

2.7.47

2 years ago

2.7.46

2 years ago

2.7.45

2 years ago

2.6.45

2 years ago

2.5.45

2 years ago

1.5.45

2 years ago

1.5.44

2 years ago

1.5.43

2 years ago

1.4.43

2 years ago

1.3.43

2 years ago

1.2.43

2 years ago

1.2.42

2 years ago

1.2.41

2 years ago

1.2.40

2 years ago

1.2.39

2 years ago

1.2.38

2 years ago

1.2.37

2 years ago

1.2.36

2 years ago

1.2.35

2 years ago

1.2.34

2 years ago

1.2.33

2 years ago

1.2.32

2 years ago

1.2.31

2 years ago

1.2.30

2 years ago

1.2.29

2 years ago

1.2.28

2 years ago

1.2.27

2 years ago

1.2.26

2 years ago

1.2.25

2 years ago

1.2.24

2 years ago

1.2.23

2 years ago

1.2.22

2 years ago

1.2.21

2 years ago

1.2.20

2 years ago

1.2.19

2 years ago

1.2.18

2 years ago

1.2.17

2 years ago

1.2.16

2 years ago

1.2.15

2 years ago

1.2.14

2 years ago

1.2.13

2 years ago

1.2.12

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago