1.0.13 • Published 3 days ago

@juigorg/iure-exercitationem-sit v1.0.13

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

@juigorg/iure-exercitationem-sit 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('@juigorg/iure-exercitationem-sit');
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

es7es8Array.prototype.findLastIndexairbnbreadablestylesheetcolourSymbolauthenticationeslintconfigsyntaxerrorbcryptirqtslibcliregularendpointboundcryptoparentsdeepcopyfunctionArray.prototype.findLastcontainsstyled-componentsECMAScript 2023tapqueuecolorfindLastES2022fullRxstatuspackagerouteownglacierbyteLengthschemeerrornameswatchingclassnameutilitiesstylebeanstalkautoprefixerrfc4122symbolweaksetconfiggradients cssqsconsoleintrinsicttyes5configurableObject.valuesargs0settingsstreamsUnderscoredeep-cloneWeakSetprocessterminalObservablesECMAScript 3ECMAScript 2021fpsECMAScript 2022getintrinsicformatdescriptiondefineratevaluecomputed-typesfast-cloneflatMapmonorepoequaldatastructurecolors_.extendtoStringTagTypeBoxReactiveXreadrobustefficientprotopostcss-pluginloadingeslintpluginoptimistECMAScript 6getOwnPropertyDescriptorvariablescommandstdlibtoArrayReflect.getPrototypeOfassertseslintmatcheshas-owncompile lesstoolsbannerlinewrappatchMicrosoftobjectgroupmake dirsesenderdynamodbCSSES2019AsyncIteratores-abstractmkdirArrayRegExp.prototype.flagses2016utilityarrayspropajaxfastcloneemitlibphonenumberStyleSheetsortedjsximmergraphqlfastifyfiltereventsescapebyteOffsetenvArrayBuffermrukarmafindupnegative zeroObject.definePropertyio-tswarningchaisymlinkoutputfindtostringtagmergeeast-asian-widthWeakMapfastcopyslotwordbreakrapidtoolkitconcatrequirermdirsignalsproxyinterruptsargparselook-upwordwrapunicodeparsingcore-jstestvalidvariables in csshttpslinkrgbmoment-0swfyupSetless mixinscloudformationpredictablearraylanguageaststablesetPrototypeOfsideUint8ArrayweakmapeventDispatcheroncecode pointsyamlgetoptforEachcallbindArray.prototype.includesworkerspeedinferencelessURLSearchParamsES5tapesomeprotobufnested cssguidfindLastIndexES7fast-copyES2021preserve-symlinksphonelazyPushInt8Arrayes-shim APIjavascriptpyyamlUint32Arraycommand-linecsscjktaskconcurrencystringifyflatstarterfast-deep-clonerandomES2020descriptorsclasseshotreplayvalidateES2016Streamsreal-timedomdatePromisewaitcss-in-jsawaitzeroglobIteratorl10nsyntaxwalkdeep-copycloudfrontbundleromitBigUint64Arraypushloggerfile systemfseventselbpropertiesmapreduceiterationObject.assignes2018idlebundlingwaftypedarrayshashgettertyperesolveieiamJSONcodesserializationreducerlimitrecursivehigher-orderiscreatepackage.jsonSymbol.toStringTagapolloECMAScript 2015typedpostcssinternaltelephoneimmutablehasOwnPropertysimpledbless compilerstyleguidea11yagentfsredux-toolkitkoreanhardlinkspluginschemalistenersnopeasciiuproute53call-bindUint8ClampedArrayruntimeajvdataviewnpmaccessoropenReactiveExtensionsamazonchromiumnumberObservableperformancemimetypesparsertouchexectrimLeftprototypemacosjsdiffhttpbddcall-boundhasregular expressionshelpersqueryqueueMicrotaskminimalArrayBuffer.prototype.slicebindtraversewritableexpressionvisualhookspasswordnativenamecensoroptionformattingidRFC-6455limitedfromcommandermoduleclientelmcallboundreact-testing-librarydefinePropertybusyisConcatSpreadableemojispinnersnodesymlinksdependencies256Array.prototype.containspathsetterpropertymulti-packagetexttc39es6shellshamtypeofstylesjsonpathjestcollection.es6polyfillObjectless.jswebCSSStyleDeclarationuuidless csslintdataYAMLfull-widthserializemobileelasticachewindowsrangeerrorhookformprivate datajoiawsdeepwritelinuxenumerableprefixencryptionremovetypespreprocessorURLECMAScript 2017equalityecmascriptslicebatchdeterministicString.prototype.trimflagparsemkdirsfigletcolumnspromisedifferror-handlingbrowserslistdom-testing-libraryawesomesaucetddreadablestreamtrimhandlersponyfillwidthloadbalancingwhatwgbootstrap lesstesterxtermES2018cloudwatchargvcurl.envassertionfunctionsjQueryvalidationrm -rfdropTypedArraycloudsearchHyBidirectorysetstylingcharacterprivatewhichlivekeysdebuggerRxJSECMAScript 2016react-hook-formgenericswgetdescriptorartECMAScript 2019reduceiteratorES2015toSortedrm -frredactmiddlewareregexp
1.0.13

3 days ago

1.0.12

4 days ago

1.0.11

5 days ago

1.0.10

6 days ago

1.0.9

7 days ago

1.0.8

8 days ago

1.0.7

9 days ago

1.0.6

10 days ago

1.0.5

11 days ago

1.0.4

12 days ago

1.0.3

13 days ago

1.0.2

14 days ago

1.0.1

15 days ago

1.0.0

15 days ago