2.10.70 • Published 11 months ago

@hishprorg/quod-veritatis v2.10.70

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

11 months ago

2.10.69

11 months ago

2.10.68

11 months ago

2.9.68

11 months ago

2.9.67

11 months ago

2.9.66

11 months ago

2.9.65

11 months ago

2.9.64

11 months ago

2.9.63

11 months ago

2.9.62

11 months ago

2.9.61

11 months ago

2.9.60

11 months ago

2.9.59

12 months ago

2.9.58

12 months ago

2.9.57

12 months ago

2.9.56

12 months ago

2.8.56

12 months ago

2.7.56

12 months ago

2.7.55

12 months ago

2.7.54

12 months ago

2.7.53

12 months ago

2.7.52

12 months ago

2.7.51

12 months ago

2.7.50

12 months ago

2.7.49

12 months ago

2.7.48

12 months ago

2.7.47

12 months ago

2.7.46

12 months ago

2.7.45

12 months ago

2.6.45

12 months ago

2.5.45

12 months ago

1.5.45

12 months ago

1.5.44

1 year ago

1.5.43

1 year ago

1.4.43

1 year ago

1.3.43

1 year ago

1.2.43

1 year ago

1.2.42

1 year ago

1.2.41

1 year ago

1.2.40

1 year ago

1.2.39

1 year ago

1.2.38

1 year ago

1.2.37

1 year ago

1.2.36

1 year ago

1.2.35

1 year ago

1.2.34

1 year ago

1.2.33

1 year ago

1.2.32

1 year ago

1.2.31

1 year ago

1.2.30

1 year ago

1.2.29

1 year ago

1.2.28

1 year ago

1.2.27

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.2.24

1 year ago

1.2.23

1 year ago

1.2.22

1 year ago

1.2.21

1 year ago

1.2.20

1 year ago

1.2.19

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.2.16

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago