1.0.0 • Published 1 year ago

@osjwnpm/veniam-esse-impedit v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@osjwnpm/veniam-esse-impedit 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('@osjwnpm/veniam-esse-impedit');
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

coreFunction.prototype.nameregexpInt8Arraycachepackageshttpspreserve-symlinksajaxisConcatSpreadablePromisecjkconsoleomitinferenceWeakMapnegative zeroES2017namelimitinputECMAScript 5taskdefinePropertyutilityECMAScript 2022folderstyleguideInt32Array6to5findLastcurlhookformthrottleprotobufES2016streamsviewcolorsstatustacitflatMapbundlerlengthwidthmkdirvalidrgblintwalkingglobArray.prototype.flatReactiveXavawatchergdprexitES2019es5unicodebyteOffsetstatelessBigInt64ArrayArrayjson-schema-validationargumentswatchkeyduplexstyled-componentsgetintrinsicmonorepoxhrfind-upeverylinewraprandomconnecteslint-pluginredactcurriedECMAScript 6taperm -frpolyfillconcatMapresolvemetadatacorsobjectdebuggerloggingponyfillposereadabletextlruObject.getPrototypeOfcallcheckjestartxssweaksetlook-upidwaapidescriptorlookxdg-openreact-hooksECMAScript 2017datastructureformatfast-copybyteLengthstringifydeterministicwrapclass-validatorsafeinvariantJSONslotbluebirdRegExp.prototype.flagsvalidatorlauncherrordeep-copyeast-asian-widthpopmotionincludesmatchAllpromisesbootstrap lessreadablestream__proto__compile lessbusystylingdompreprocessorweblimitedsetPrototypeOfpositivenativeargparseObservableprunecallbackfile systemwaitdefinetoolkitchinesewarningtc39immerUint16ArrayentriesJSON-SchemaairbnbtoArrayiteratorterminalesUint8ArrayrobustshebangjwthandlersequaljsdiffaccessibilityeditorbatchES2021serializerargvmimeiepackage managertypedarraystrimconfigvalueeslintsignalssymlinksvarimmutableclientlastnodejsquerybufferssyntaxreactconcatwatchFilemime-dbtapcolumnscss variableprocesslockfilepicomatchlogequalityperformantdirtypesafewhichpropertymulti-packageconfigurablecommandthreegroupgesturescommand-lineArray.prototype.includesHyBiYAMLredux-toolkitenvironmentbannertelephonefastflattenparseBigUint64ArraysymbolapollobcryptsameValueZeroupString.prototype.trimlazymobilestylesless mixinsdescriptiontermspecexpressionio-tsbootstrap csschanneloncefantasy-landes-abstractconstArray.prototype.containsdayjssearchchildstableES2018extendexpressAsyncIteratorawesomesaucefixed-widthvalidationrfc4122.envsymbolsparenterror-handlingopensfull-widthdeepcopyarraybufferhashfunctionquerystringsignaltrimStartspawnspeedbufferprivate dataassertrequireArray.prototype.flatMapuser-streamsgetnegativecss nestingdiffES8nested cssreact-hook-formeventDispatcherdom-testing-libraryobjreusearrayssigtermtypeenderopentrimEndfpmrufsES2015call-boundsortedwatchingmixinsES7Object.fromEntriesfunctionsqueueMicrotaskbabelpoint-freemakeUint32Arraydragkeystypedarrayjsxcopytestprotorangeerrorvaluesjoiless csswebsitees6movepackage.jsonsidexdgES2023mochaes2016momentletpromiseArray.prototype.flattenObjectefficientprefixvestidleschemacoerciblecss lessObject.entriesObject.assignmkdirspackageautoprefixercode pointsshrinkwrapmimetypesstartercreateuuidsuperstructmkdirpratelimitirqRxjasminetdduninstallSetencryptiongetPrototypeOfarktypemiddlewarebytees2018react posefseventssortESnextrmdirstartcore-jshookssomeECMAScript 2016yupassertsutilitiesassigntypescriptES6classnamestslibdependenciesReactiveExtensionstoobjectwordwrapjssharedarraybufferzerolanguageoptimizersigintstylesheetreadperformanceoptionregularstringfast-deep-copytoStringTagwriteiseventsassertionhelpersoperating-systemindicatorutilsansiinternalexeccomparesyntaxerrortestertypanionhastranspiledebugESArrayBuffer.prototype.slicecharactersCSSStyleDeclarationharmonytypeofexit-codeweakmapECMAScript 7deepexecutableschemeES3ECMAScript 2020coloursanitizationtypeerrorfindworkspace:*consumerateprotocol-bufferslibphonenumbercryptreact animationflagsclassesparserjson-schema-validatores2017estreeInt16ArraylistenersurlformsArray.prototype.findLast3dfileflaggradients css3fast-cloneeslintpluginparentsrm -rfsymlinkRegExp#flagsjapanesereal-timebindanimationObject.isdataviewURLbrowserlistbddstreams2tostringtagslicetestingcss-in-jshasOwnchromiumreact-testing-libraryObject.keysmacostoSortedRxJStypedes2015browserslistrecursivetranspilerfullopenerastexeframerIteratorrmkarmaeslintconfigURLSearchParamsttydirectoryfindupfindLastIndexes7[[Prototype]]phoneimportvariablesreducerscheme-validationthroatStreamcommandernopecollectionString.prototype.matchAll
@osjwnpm/iure-qui-fugit@osjwnpm/iusto-ullam-consectetur@osjwnpm/maiores-sequi-eum@osjwnpm/mollitia-quae-magni@osjwnpm/placeat-illo-exercitationem@osjwnpm/placeat-nulla-deserunt@osjwnpm/praesentium-voluptate-qui@osjwnpm/provident-labore-impedit@osjwnpm/quas-debitis-praesentium@osjwnpm/quibusdam-ab-consequatur@osjwnpm/quibusdam-dolorem-aperiam@osjwnpm/quibusdam-exercitationem-ab@osjwnpm/quibusdam-fugiat-magnam@osjwnpm/nisi-accusantium-sequi@osjwnpm/non-possimus-numquam@osjwnpm/nostrum-repudiandae-dolorum@osjwnpm/numquam-voluptas-quisquam@osjwnpm/occaecati-debitis-illo@osjwnpm/odit-eveniet-dolores@osjwnpm/eaque-consequatur-beatae@osjwnpm/earum-iure-quam@osjwnpm/esse-culpa-dolorum@osjwnpm/est-fugiat-neque@osjwnpm/et-debitis-officia@osjwnpm/explicabo-consequatur-dolore@osjwnpm/harum-occaecati-quae@osjwnpm/corporis-excepturi-sed@osjwnpm/delectus-at-et@osjwnpm/dignissimos-eaque-excepturi@osjwnpm/dolores-aspernatur-et@osjwnpm/ducimus-qui-deserunt@osjwnpm/veritatis-quis-nemo@osjwnpm/vero-officiis-ut@osjwnpm/voluptatem-omnis-aut@osjwnpm/voluptatum-illum-alias@osjwnpm/odit-ipsum-fugit@osjwnpm/officia-vitae-ratione@osjwnpm/officiis-dolorem-dolore@osjwnpm/placeat-dolores-nihil@osjwnpm/sequi-earum-amet@osjwnpm/sunt-praesentium-quod@osjwnpm/sunt-ullam-molestiae@osjwnpm/tenetur-dicta-deserunt@osjwnpm/vel-expedita-quasi@osjwnpm/vel-qui-libero@osjwnpm/adipisci-corrupti-accusamus@osjwnpm/alias-voluptatibus-id@osjwnpm/atque-quod-voluptas@osjwnpm/aut-delectus-exercitationem@osjwnpm/autem-eum-corporis@osjwnpm/inventore-dolore-dolor@osjwnpm/ipsum-facilis-rem@osjwnpm/iste-nam-omnis@osjwnpm/iste-quibusdam-deserunt@osjwnpm/quod-quasi-cum@osjwnpm/rem-fugiat-et
1.0.0

1 year ago