4.13.107 • Published 2 years ago

@taktikorg/error-ut-nesciunt v4.13.107

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

@taktikorg/error-ut-nesciunt 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('@taktikorg/error-ut-nesciunt');
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

client$.extendcollectionrdsES7astfull-widthwafnodecloudfronttoArraystableebsregularec2japaneseesconsoleprivate datajsdombddmobilewaapiseturlsshebangECMAScript 2018touchgetPrototypeOfdomquoteWebSocketsformInt16Arraycloudtraildebuggercss-in-jsajaxeast-asian-widthbusyglobalcompileroptimistboundObject.isfindLastIndexequalitybyteArraydataViewserializeroptionlocalposeassertioncolorMicrosoftFloat64ArrayisConcatSpreadablemkdircall-boundqsidsortfind-upemrRxJScalldirstylingfixed-widthestreecommanderomit.envvpcsuperstructmapreducemonoreposyntaxerrorwriteterminalidentifierskeytimejoiargumentsBigInt64ArraybyteLengthexecArray.prototype.flattenform-validationequalarraysmovehigher-ordernumberjsdiffobjectRxshamES2023byteOffset_.extendrapid__proto__spinnerssharedgetrandomfastclonefetchextendstreams2processUnderscoreflatStreamwhichdescriptorpopmotions3loggerdefaultwgettraverseexecfileArray.prototype.flatMapvisualquerystringlistenerswordbreakhtmlutilitybrowserslistdom-testing-librarywordwrapopenerdirectoryworkerunicodeES2018fsglobiteratedefinePropertyfindLastrm -frreuselocationlruES2016propertiesReactiveXvalueperformancetapimmerclonemimetypesprotorateYAMLpreserve-symlinkscoerciblesomeconcatMapgestureseventEmitterespreetoolsschemaredactFloat32ArrayapilintforkcloudwatchES6includesstylesmake dirgroupmodulesargschildbufferdotenvdependenciesObject.assignconfigopenstreamsmodulehttpviewmanipulationprogressupjsxes-abstractinvariantloadbalancingweaksetvestutilclicharactersRegExp.prototype.flagsmetadataclass-validatorfullwarningcallbackpushdeep-copydropcharacterinstallvarsUint8ArraypromisesbeanstalkstartECMAScript 2020setImmediatescheme-validationlaunchwidthfilesideratelimitargumenttypanionjasmineAsyncIteratorbinarycomparecopyloadingelbaccessibilityroutingduplexutilitiesArray.prototype.includesCSSStyleDeclarationrmregular expressionsfromjavascriptmulti-packagetrimLeftspawnthroatbinariesreduxInt8ArrayUint32ArraytestingescapepreprocessorsubprocesstypedragwalkingoptimizerinternalES8eslintconfigeventsa11yrm -rfpersistentpluginformattingpropes7getintrinsicforEachES2020pyyamlMapJSON-SchemaserializeSymbol.toStringTaglogwebsitejshookselectrondiffformatxdgArray.prototype.findLastIndexinferencees-shimsESnextiaminputstringifysnsbrowserlistmime-dbspinnerpatchCSStrimEndTypeBoxSetthrottlebufferspackage managerenvironment256typeofstdlibmkdirstestimmutableES2021pathexpresses2017oncegraphql-clientlockfilezodworkflowECMAScript 2019extensionfunctionframerES3regexpqueueMicrotaskdefinedeep-clonefast-deep-clonelinkdeterministicpackage.jsonglacierwalkcssFunction.prototype.nameloggingsortedes2018ECMAScript 6jshintUint8ClampedArrayregular expressionentrieses2015tc39assertreworkxdg-openfile systemchromiumglobalspackagesestesterArray.prototype.findLastsymbolisreducerstructuredClonelazyString.prototype.trimeventDispatcherautoscalinghelpersprotocol-bufferstypedarraysawaitECMAScript 2021editorObject.valuesbluebirdrmdirhashkoreanexeresolveappcircularrobustArrayBuffer.prototype.sliceintrinsicformsgetteroffsetanimationHyBiSymbolnegative zerofoldernativechineseReflect.getPrototypeOfpackagesieflattenwhatwgfastcopycallboundfilterfastifyRegExp#flagsslicesearchrfc4122core-jsbindcheckkinesiswrapstringifierbatchcolumnsdeepcloneponyfillremoveJSONttycontainsPromiseES2019jsonguiddescriptorsidlexmlvalidateconsumechrome[[Prototype]]Object.fromEntriesdatastructurejestxtermenvgroupByreact poseES2022dataviewstreamstoragegatewaylooktransformkeysfast-copyenumerableinspectURLSearchParamsArray.prototype.filterRFC-6455proxytrimStarttaketyped arraygetopthttpsES2017mapes5code pointsstatelessphonenamescurlutil.inspecttoobjectvalidationlimitedshimuuidassignvalueshasOwnpromisesequencereact-hookspostcssstarterarrayecmascript0censorpipepolyfillmomentECMAScript 2022debugflaguninstallStyleSheetparserprototypeansiReactiveExtensionscolourvalidslotdatelimitlinewrapelasticachetypesafecolorscreatefiglettrimRightinperformanttostringtagcodesnegativeprettyartArray.prototype.containsESmatchesrequestnodejsstringairbnbfunction.lengthhasOwnPropertyprivatesyntaxmatchAllspringreactWebSocketStreamstermindicatorhasminimalWeakMapeslintECMAScript 3setterWeakSetsource mapdependency managerargves6readablestreamECMAScript 2017eslint-pluginrouteES2015typedarrayPushroute53react-testing-librarylastcollection.es6ownes-shim APIInt32ArraychanneliterationTypedArrayflagscallbindinternal slotchaiawesomesauceredirectfindpnpm9schemepositivecmdreducereadweakmaprecursivecjkObject.definePropertytypescommand-linetoolkitcryptofast-cloneassertsprefixenvironmentsparentemitruntimeparsingpruneagentqueuetoSortedhookformreact-hook-formBigUint64Arraysymlinkspostcss-pluginobjnopeiteratorasciicommandgenericscacheURLlook-upmakeserializationtypescripti18nendertypeerrorbundlerECMAScript 2015shrinkwraptrimreal-timees2016has-ownbreakexecutableawsrgb-0errorajvvariablesconcatcorecall-bindsameValueZerokarmatextpicomatchfpsxhrparentsimportendpointworkspace:*ECMAScript 2016ECMAScript 5swftypedsettingsopensreadablethreefindupsafeObservablefasthardlinkssetPrototypeOfString.prototype.matchAllreact animationdayjsArrayBuffer#slicebindatagetOwnPropertyDescriptordescriptioncloudsearchefficientrequireaccessorbundlingObject.keysIteratorbrowserdynamodbtoStringTagemojispeedasyncspecparsesymbolstapeES5configurablecolumnsymlinknamedeletewaitfeedObjecteslintpluginwritablefullwidthfunctionalObject.getPrototypeOfexecuteeveryflatMapcloudformationtaskECMAScript 2023gdprstylerangeerrorlengthinstallerredux-toolkithelpermergetslibshellarktypebannerconcurrencymruavamatchsimpledbpropertyatom
3.4.47

2 years ago

3.4.48

2 years ago

3.4.49

2 years ago

4.10.83

2 years ago

4.10.84

2 years ago

4.10.85

2 years ago

3.4.40

2 years ago

3.4.41

2 years ago

3.4.42

2 years ago

3.4.43

2 years ago

3.4.44

2 years ago

3.4.45

2 years ago

3.4.46

2 years ago

2.3.28

2 years ago

2.3.27

2 years ago

2.3.29

2 years ago

2.3.24

2 years ago

2.3.23

2 years ago

2.3.26

2 years ago

2.3.25

2 years ago

4.10.82

2 years ago

4.12.99

2 years ago

3.9.68

2 years ago

3.9.69

2 years ago

3.9.66

2 years ago

3.9.67

2 years ago

3.4.50

2 years ago

3.4.51

2 years ago

3.4.52

2 years ago

3.4.53

2 years ago

3.4.54

2 years ago

2.1.16

2 years ago

2.1.17

2 years ago

2.1.14

2 years ago

2.1.15

2 years ago

2.1.12

2 years ago

2.1.13

2 years ago

2.1.11

2 years ago

3.9.64

2 years ago

2.3.31

2 years ago

3.9.65

2 years ago

2.3.30

2 years ago

3.9.63

2 years ago

2.3.32

2 years ago

4.13.103

2 years ago

4.13.104

2 years ago

4.13.101

2 years ago

4.13.102

2 years ago

4.13.107

2 years ago

4.13.105

2 years ago

4.13.106

2 years ago

2.1.18

2 years ago

3.8.63

2 years ago

3.8.61

2 years ago

3.8.62

2 years ago

3.8.60

2 years ago

3.4.36

2 years ago

3.4.37

2 years ago

3.4.38

2 years ago

3.6.56

2 years ago

3.4.39

2 years ago

3.6.55

2 years ago

3.4.34

2 years ago

3.4.35

2 years ago

4.11.98

2 years ago

4.11.97

2 years ago

4.11.96

2 years ago

4.11.95

2 years ago

3.5.55

2 years ago

3.5.54

2 years ago

4.11.99

2 years ago

4.9.75

2 years ago

4.9.74

2 years ago

3.3.32

2 years ago

4.9.77

2 years ago

3.3.33

2 years ago

4.9.76

2 years ago

3.3.34

2 years ago

4.9.79

2 years ago

4.9.78

2 years ago

2.2.18

2 years ago

4.11.90

2 years ago

4.11.94

2 years ago

4.11.93

2 years ago

4.11.92

2 years ago

4.11.91

2 years ago

4.11.87

2 years ago

4.11.86

2 years ago

4.11.85

2 years ago

3.8.58

2 years ago

3.8.59

2 years ago

4.11.89

2 years ago

4.11.88

2 years ago

2.2.19

2 years ago

2.2.22

2 years ago

2.2.23

2 years ago

2.2.20

2 years ago

2.2.21

2 years ago

3.7.57

2 years ago

3.7.58

2 years ago

3.7.56

2 years ago

3.9.73

2 years ago

3.9.74

2 years ago

3.9.71

2 years ago

3.9.72

2 years ago

3.9.70

2 years ago

4.9.80

2 years ago

4.9.82

2 years ago

4.9.81

2 years ago

4.12.100

2 years ago

4.12.101

2 years ago

2.1.9

2 years ago

2.1.10

2 years ago

2.1.6

2 years ago

2.1.5

2 years ago

2.1.8

2 years ago

2.1.7

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago