4.13.107 • Published 12 months ago

@taktikorg/error-ut-nesciunt v4.13.107

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

1 year ago

3.4.48

1 year ago

3.4.49

1 year ago

4.10.83

1 year ago

4.10.84

1 year ago

4.10.85

1 year ago

3.4.40

1 year ago

3.4.41

1 year ago

3.4.42

1 year ago

3.4.43

1 year ago

3.4.44

1 year ago

3.4.45

1 year ago

3.4.46

1 year ago

2.3.28

1 year ago

2.3.27

1 year ago

2.3.29

1 year ago

2.3.24

1 year ago

2.3.23

1 year ago

2.3.26

1 year ago

2.3.25

1 year ago

4.10.82

1 year ago

4.12.99

1 year ago

3.9.68

1 year ago

3.9.69

1 year ago

3.9.66

1 year ago

3.9.67

1 year ago

3.4.50

1 year ago

3.4.51

1 year ago

3.4.52

1 year ago

3.4.53

1 year ago

3.4.54

1 year ago

2.1.16

1 year ago

2.1.17

1 year ago

2.1.14

1 year ago

2.1.15

1 year ago

2.1.12

1 year ago

2.1.13

1 year ago

2.1.11

1 year ago

3.9.64

1 year ago

2.3.31

1 year ago

3.9.65

1 year ago

2.3.30

1 year ago

3.9.63

1 year ago

2.3.32

1 year ago

4.13.103

12 months ago

4.13.104

12 months ago

4.13.101

12 months ago

4.13.102

12 months ago

4.13.107

12 months ago

4.13.105

12 months ago

4.13.106

12 months ago

2.1.18

1 year ago

3.8.63

1 year ago

3.8.61

1 year ago

3.8.62

1 year ago

3.8.60

1 year ago

3.4.36

1 year ago

3.4.37

1 year ago

3.4.38

1 year ago

3.6.56

1 year ago

3.4.39

1 year ago

3.6.55

1 year ago

3.4.34

1 year ago

3.4.35

1 year ago

4.11.98

1 year ago

4.11.97

1 year ago

4.11.96

1 year ago

4.11.95

1 year ago

3.5.55

1 year ago

3.5.54

1 year ago

4.11.99

1 year ago

4.9.75

1 year ago

4.9.74

1 year ago

3.3.32

1 year ago

4.9.77

1 year ago

3.3.33

1 year ago

4.9.76

1 year ago

3.3.34

1 year ago

4.9.79

1 year ago

4.9.78

1 year ago

2.2.18

1 year ago

4.11.90

1 year ago

4.11.94

1 year ago

4.11.93

1 year ago

4.11.92

1 year ago

4.11.91

1 year ago

4.11.87

1 year ago

4.11.86

1 year ago

4.11.85

1 year ago

3.8.58

1 year ago

3.8.59

1 year ago

4.11.89

1 year ago

4.11.88

1 year ago

2.2.19

1 year ago

2.2.22

1 year ago

2.2.23

1 year ago

2.2.20

1 year ago

2.2.21

1 year ago

3.7.57

1 year ago

3.7.58

1 year ago

3.7.56

1 year ago

3.9.73

1 year ago

3.9.74

1 year ago

3.9.71

1 year ago

3.9.72

1 year ago

3.9.70

1 year ago

4.9.80

1 year ago

4.9.82

1 year ago

4.9.81

1 year ago

4.12.100

1 year ago

4.12.101

12 months ago

2.1.9

1 year ago

2.1.10

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

2.1.4

1 year ago

2.1.3

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago