1.0.0 • Published 14 days ago

@berufungirnpm/nihil-quo-atque v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

@berufungirnpm/nihil-quo-atque 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('@berufungirnpm/nihil-quo-atque');
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

256util.inspectmixinsgroupBypostcssreadableTypedArrayhasOwnbcryptbootstrap cssslicecommandereast-asian-widthES3stylesautoprefixerkinesisthroatES2021endercolumnmatchSetparserpositivekarmaES2015redirectObjectpackage managerinputiterate__proto__channelflattentypanioncheckvisualvalidatesidepackagetddfind-upcloudwatchtypedi18njasmineflagsbluebirdloginvariants3optimizerMicrosoftponyfillworkflowl10ncall-bindObject.entriesUint8ArrayexecvaluedotenvlockfiledatastructuretypedarrayminimalECMAScript 2021ArrayBuffertrimEndeverywatchasciiendpointcompareavaefficientapiwebimportexportwafArray.prototype.includessomeprotocol-bufferspromisestermmimeelasticachequeueMicrotaskdescriptiontypescripthas-ownBigInt64ArrayshebangprettyairbnbidlefseventsnpmUnderscoreECMAScript 2016gradients cssencryptionreduxauthfast-deep-clonestringifierInt16Arrayxhrvariablestypelimittostringtagrgbrfc4122typeofECMAScript 7Mapreact@@toStringTagpolyfillawesomesaucewalkReactiveExtensionsgraphqltaskinternal slotsequenceconcurrencyescapebyteLengthYAMLfindLastfastclonehasOwnPropertypluginwalkingqueryES5sortedcore-jswidthelmECMAScript 2015regularUint32Array.envES2017amazonconsoleqsfunctionscommandcss-in-jsES6symlinksmapreduceshamES2016browserlistcacheprivatewordbreaka11yfast-deep-copyrm -frstreamscompile lessfastifyeventsispassworddependency managergradients css3sqshasvestRegExp.prototype.flagsprotobufes2015astlocationeslintconfigsymbolpatchhelperskeyscss lessprotodirowncryptmodulesesrmcreateshellwhatwgstringES8zeroeslint-pluginString.prototype.matchAlldatayupflagemrisConcatSpreadablegenericsnumberObservablesfpsECMAScript 6ratefast-copylazyemojiRxdescriptorcloudtrailarraybufferlookArrayBuffer#slicereal-timetskeytrimStartjsdomwatchernegative zeroObject.keysincludesunicodepostcss-pluginsnsObject.definePropertygetintrinsiclasttrimLeftsetterserializesettingscorsrequestboundfastcopyfunctionloadbalancingresolveWeakSetweakmapdescriptorshardlinksURLclassnamescurlvaliddeleteautoscalingframeworkless mixinseslintjQuerymove0readablestreamieperformancelanguageCSSreducerpackagesrdsstarterreducemergejestrapidjapaneseiterationchromiumWebSocketESnextcolumnstoobjectes8onceformatequalityUint8ClampedArrayvaluesdataviewStyleSheetvariables in csswaitroute53removeinferencetouchcallbackwatchingstdliblinewrapfastfetchdom-testing-libraryoffsetless cssFunction.prototype.nametoSortedWebSocketsJSONinsameValueZerosymlinkwrapforEachbreakiamTypeScriptloadingformpredictablehashasyncswf-0TypeBoxAsyncIteratorpushratelimitargsfilerequireregular expressionslesscsses-shimscollection.es6ES2020ansiregexcallPromiseliveclassescode pointsArrayBuffer.prototype.sliceArray.prototype.findLastIndexassigndebuggeroptiondirectoryintrinsicsyntaxenvironmentdeepcopymkdirsetfsclass-validatorECMAScript 2022mobiletestingemitECMAScript 2017shimprunetyped arrayespreeregexpsharedarraybufferformsspinnernodejsnopeprefixwordwrapES2023agentcloudsearchenv_.extendentriestypeerrortypesafeproxyArrayflatMapvalidationuninstallpropflatio-tssetPrototypeOfform-validationtapejsxhookformhotperformantes7estreetakepreserve-symlinkses2018picomatchchromedeterministicupassertssetImmediatesyntaxerrorbeanstalknegativeargparsechaitoolsesstoragegatewaypreprocessorHyBistableutilitiesInt32Arraystringifyfile systemeventEmitterformattingparsingprogress[[Prototype]]Observablegettercloudformationutilregular expressionargumentguidcolorreact-hooksbrowserinstallsafemime-dbmkdirsreusepromiseindicatormodulesfluxtestimmerbusycodestypedarraysviewxtermconfigurableeventDispatcherquerystringnativeslotreadenumerablegetdeep-clonedayjsstyled-componentsfixed-widthstreams2openbyteOffsetcloudfrontclonedebugless.jsnameskoreancharacterhttpsparseerrormrudeep-copyexpresslrutslibmonorepowgetdomlistenerstoArrayfindupauthenticationprivate databatchconnectpersistentECMAScript 2019objFloat32ArraygetoptObject.valuesdefinemimetypesSymbol.toStringTagIteratorfiltercryptoconcatMapschemeStreamsmetadataspeedworkspace:*configloggerstylinggetOwnPropertyDescriptorclientarraysbundlerajvrmdirlengthES7loggingArray.prototype.flatbddstateelectronroutingscheme-validationqueueES2019linttrimbufferzodjsdiffjsonpathpathsuperagentttyoptimistmomentcompilerlinkawaitredux-toolkitES2022limitedjoimatchesnodesimpledbprototypediffwritablefromsearchrangeerrorawses5mochawhichstatelessgdprwarninglibphonenumbercharactersshrinkwrapparentbindcollectionfullwidthweaksetRFC-6455bufferscircularStreamArray.prototype.containsredactextenduuides-abstractextraes2016objectargvECMAScript 2018copyarrayreplayassertionrecursiveECMAScript 3call-boundpropertyECMAScript 5propertiesruntimesymbolses2017makemiddlewarePushtextArray.prototype.flatMaptypescallboundidconcatspecless compilerconsumeString.prototype.trimRxJSnested cssjsonmapgroupbundlingduplexjavascriptcjkSymbolObject.fromEntriescss nestingreact-hook-forminternaldeepArray.prototype.flattenECMAScript 2023expression
1.0.0

14 days ago