2.5.75 • Published 11 months ago

@hishprorg/cupiditate-ut v2.5.75

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@hishprorg/cupiditate-ut Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Which kind of Typed Array is this JavaScript value? Works cross-realm, without instanceof, and despite Symbol.toStringTag.

Example

var whichTypedArray = require('@hishprorg/cupiditate-ut');
var assert = require('assert');

assert.equal(false, whichTypedArray(undefined));
assert.equal(false, whichTypedArray(null));
assert.equal(false, whichTypedArray(false));
assert.equal(false, whichTypedArray(true));
assert.equal(false, whichTypedArray([]));
assert.equal(false, whichTypedArray({}));
assert.equal(false, whichTypedArray(/a/g));
assert.equal(false, whichTypedArray(new RegExp('a', 'g')));
assert.equal(false, whichTypedArray(new Date()));
assert.equal(false, whichTypedArray(42));
assert.equal(false, whichTypedArray(NaN));
assert.equal(false, whichTypedArray(Infinity));
assert.equal(false, whichTypedArray(new Number(42)));
assert.equal(false, whichTypedArray('foo'));
assert.equal(false, whichTypedArray(Object('foo')));
assert.equal(false, whichTypedArray(function () {}));
assert.equal(false, whichTypedArray(function* () {}));
assert.equal(false, whichTypedArray(x => x * x));
assert.equal(false, whichTypedArray([]));

assert.equal('Int8Array', whichTypedArray(new Int8Array()));
assert.equal('Uint8Array', whichTypedArray(new Uint8Array()));
assert.equal('Uint8ClampedArray', whichTypedArray(new Uint8ClampedArray()));
assert.equal('Int16Array', whichTypedArray(new Int16Array()));
assert.equal('Uint16Array', whichTypedArray(new Uint16Array()));
assert.equal('Int32Array', whichTypedArray(new Int32Array()));
assert.equal('Uint32Array', whichTypedArray(new Uint32Array()));
assert.equal('Float32Array', whichTypedArray(new Float32Array()));
assert.equal('Float64Array', whichTypedArray(new Float64Array()));
assert.equal('BigInt64Array', whichTypedArray(new BigInt64Array()));
assert.equal('BigUint64Array', whichTypedArray(new BigUint64Array()));

Tests

Simply clone the repo, npm install, and run npm test

Int16ArrayInt8ArrayloadingclassnamesArray.prototype.findLastIndexpostcss-pluginObject.entriesECMAScript 2016dateserializationmatchback-endutillogjsdomloadbalancingroute53npmimportdom-testing-librarypicomatch6to5airbnbmovedescriptionpoint-freeloggingobjectstoragegatewayphoneES2023setPrototypeOfregular expressionendpointforktoStringTagomitreal-timeelblintWeakSetsyntaxerrormanagerprotoreduceassertdeepcopyeventEmitteroffsetpositiveObject.valuesjsonschemaCSSfullwidthfull-widthpruneharmonymodulesreadablestreampassworddeep-clonegroupECMAScript 2020characterschemees6PromisebusychaiES2022jwtutilitiesfetch0zodcolumnsBigInt64ArraysqsrequestasyncjestinterruptsmapprivateES2015assertsservicebeanstalkajvcjkcollectionURLSearchParamscoregenericsspringponyfillforEachAsyncIteratorPushmetadatahandlersaccessorwriteclientflagsrouteidlepreprocessordependenciesglobsameValueZeroclassnameselfkeysless mixinsmockingiterateECMAScript 6letfunction.lengthcss-in-jsArrayBuffer#sliceWebSocketframerhelpersutilityless compilerstyleguidelinkES2020authenticationpropertysomeprotocol-buffersprogressdeep-copycryptojson-schemautilsSetpnpm9ESfluxBigUint64ArraybinariesinregexES2021typedarrayes2015getTypeScriptconfigurablesettingsArrayBufferfindLastIndexconcathelperprettyterminalstartersortdependency managerwaituser-streamses-shim APIimportexporteffect-tsmergeexecfilenumberstructuredClonemapreducehttpsassertiondragnativebyteOffsetcallbindreact-hooksvalidatorsigintES8trimRightnodees2018package.jsonCSSStyleDeclarationhotgetPrototypeOfgetterwritableruntimereducersafemobilewidthfast-copyawsECMAScript 2023serverstreams_.extendlessqueryspinnerscopyapimodulespeedlruminimaltraverseexpressionECMAScript 5definejQuerykeyES2018dotenvrequireObject.keysECMAScript 2019cloudwatchwindowshandlertoSortedprivate datasuperstructchromiumperformanceeslintconfigcheckrdsspecextendObservablesdeletetestfrompersistentec2eslintpluginapolloboundsidetoolsbabeldomreact-componentmulti-packagedatastructurebindpathglobalformanimationwalkaccessibilitydirectorylivecensorStreamsloggerbcryptIteratorpackagesfastcopyWebSocketsbrowserslisttypeerrorconcatMapslotconsolebabel-corei18nes8redirectencryptionpinoArray.prototype.findLastexit-codenpmignorebyteLengthfunctionallockfilepredictableflageast-asian-widthESnextgetoptinferenceglobal this valueshrinkwrapbrowserECMAScriptpuretrimStartsymlinksglobal objectinternalagentsignalrangeerrorshellnodejscolortypedvalidexpressjsonjson-schema-validatortestertoobjectespreereplayargumentReactiveExtensionsbundlercss variablereadless cssebserrortimeemrUnderscorefastifyautoscalinghigher-ordertakesortedcss lessperformantfastObject.getPrototypeOfchildhooksObjectlesscssweaksettdddefinePropertyInt32Arrayopensslarraybufferfastclonepromisespawnes7namestoArrayes2016operating-systemMapvpccompile lessRFC-6455typed arrayTypeBoxpatchuninstallisidentifiersclass-validatorbinaryconstenvironmentcircularfpdayjsstylesFloat64ArrayfiletostringtagECMAScript 2015execcolourartelasticache$.extendproxylastpyyamlimmutablearrayECMAScript 2022react poseequalstablebytesyntaxieignorecodestrimfulldatamixins
2.5.75

11 months ago

2.5.74

11 months ago

2.5.73

11 months ago

2.5.72

11 months ago

1.5.72

11 months ago

1.5.71

11 months ago

1.4.71

11 months ago

1.4.70

11 months ago

1.4.69

11 months ago

1.4.68

11 months ago

1.4.67

11 months ago

1.4.66

11 months ago

1.4.65

11 months ago

1.4.64

11 months ago

1.3.64

11 months ago

1.3.63

11 months ago

1.3.62

11 months ago

1.3.61

11 months ago

1.3.60

11 months ago

1.3.59

11 months ago

1.3.58

11 months ago

1.3.57

11 months ago

1.3.56

11 months ago

1.2.56

12 months ago

1.2.55

12 months ago

1.2.54

12 months ago

1.2.53

12 months ago

1.2.52

12 months ago

1.2.51

12 months ago

1.2.50

12 months ago

1.2.49

12 months ago

1.2.48

12 months ago

1.2.47

12 months ago

1.2.46

12 months ago

1.2.45

12 months ago

1.2.44

12 months ago

1.2.43

12 months ago

1.2.42

12 months ago

1.2.41

12 months ago

1.2.40

12 months ago

1.2.39

12 months ago

1.2.38

12 months ago

1.2.37

12 months ago

1.2.36

1 year ago

1.2.35

1 year ago

1.2.34

1 year ago

1.2.33

1 year ago

1.2.32

1 year ago

1.2.31

1 year ago

1.2.30

1 year ago

1.2.29

1 year ago

1.2.28

1 year ago

1.2.27

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.2.24

1 year ago

1.2.23

1 year ago

1.2.22

1 year ago

1.2.21

1 year ago

1.2.20

1 year ago

1.2.19

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.2.16

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.1.9

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago