2.5.74 • Published 1 year ago

@hishprorg/rerum-qui v2.5.74

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

@hishprorg/rerum-qui 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/rerum-qui');
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

nameses5localtypescriptregexpfetcheventshardlinkstypedserializersymlinkECMAScript 3argvformattinghas-ownECMAScript 7Uint8ClampedArrayfullprivate datathreevalueimmerclassesRegExp#flagstypeerrorprocessajaxkeyutilsreact-hook-formgrouptestpluginpreserve-symlinkstextasyncqueueReactiveXartlinuxsubprocessiteratortrimparserselffpsvaliditerationbyteOffsettddArray.prototype.findLastIndexencryptiongestureses2016patheast-asian-widthjson-schema-validatorloggingredactstreamredux-toolkitfile systemFloat64ArraylinkArray.prototype.flat_.extendECMAScript 2021descriptorCSSStyleDeclarationeverycolorsindicatortransportschemejapaneseES5ansiESObject.definePropertytypesafeReflect.getPrototypeOfdefineArray.prototype.containsxterm[[Prototype]]mapzxperformancecurlcallbindsqswhichimmutableauthenticationsymlinksinference0ES8certificatesbyteLengthfunctionscss lesscloudsearchreactfixed-widthesSetRxAsyncIteratoracorntouchvaluesarraybuffergitignorepyyamlstylesheetreact animationmodule256vestdeletefprecursivesignedUint8ArraysetPrototypeOfYAMLebsflagsymbolsa11yObject.entriesrulesfsjsdomboundtoolsdatabeanstalkasterisksdatevalidationES3storagegatewayanimationregexcsssortedimportoptionshelluser-streamsArrayBuffertoArrayroutemockperformantURLSearchParamsquerypruneerroriamcloudfrontshimwaapireal-timestringifyrequestMicrosoftarraysposecopymatchesregular expressionObject.getPrototypeOfTypeScriptvalidatorflatMapjQuerymanagerreduceres6monorepoenvECMAScript 2023spawnprettyquerystringcloudtrailmixinsargsjsonarraysharedec2dataViewexecfindLastStyleSheetgradients css3testingsigtermWebSocketviewsimpledbvariables in csschannelprotobufyupESnextruntimetyped arrayeffect-tscolumnsmulti-packagecreatefastifyinternallockfilesequenceresolvedragsharedarraybufferecmascriptchromiumtranspilerSymbolObject.keysrangeerrorbinarieshandlersendercompilerunicodecomparepersistentequalitytslibgradients cssmomentStreamrequirees2017mockingframerrdstypeofflagsCSSnpmautoprefixerless mixinsES2016sigintsetcolourminimalcommanderletcss-in-jsvpcfastclonecacheRxJSfasttoolkitglobalObject.assigninterruptssafecryptfront-endlesscssregularmake dirES2015extrayamlback-endownArray.prototype.includeshashcolorlastinputwindowJSON-Schemagdprsignalsphonehasglobalstraversedotenvcall-boundfromconstassign-0columnWeakMapnamees-shim APIreadmakeECMAScript 2018filetrimRightpoint-freelazyl10ndependenciesreadablegetOwnPropertyDescriptorconsumebundlingnegative zerobootstrap cssprogresssham3dform-validationreact poseserializegetdescriptorsserviceserveres2018slicejshintschemaflattenbuffersignalECMAScript 5writableawsbinwarningbuffershotinvariantjoibyteutilstructuredCloneECMAScript 2015full-widthcss nestingpostcssisstylesworkflowString.prototype.trimlocationTypedArrayassertionsortkeysstringoutputpasswordstyleguidewafArray.prototype.filterdropstatusPushjsfindLastIndexoptimistassertsWeakSetflatsomebrowserslistes7styleentriesBigInt64Arraypipeshrinkwraplintpropertyelmquoteeslintdom-testing-libraryglacierObject.valuesstylinghandlerstableomitextendspeedexpressionArray.prototype.flattencompile lessaccessorfullwidthprotocol-buffersutil.inspectconcatcodesqsmacosoperating-systemInt8Arraydiffponyfillairbnbawesomesaucepicomatchintrinsicnodeeslintconfigtranspilebcrypthttpcontainsmodulesworkerspringhelpersfast-cloneObjecthasOwnPropertyirqES2023hasOwnloadingUint16ArrayvarstelephonejsonschemaforkprefixexitendpointES2020elasticachequeueMicrotaskurlObservablepackage.jsonString.prototype.matchAlltacitidentifierssettingsfantasy-landcommandutilitiesmatchAlltypedarraysremoveInt16ArrayemitECMAScript 2020superagentenvironmentsweaksetcomputed-typesnopelanguagerapidsesbindstringifiergenericsoptimizerWebSocketsutilityweakmapefficientchromeECMAScript 2017waitless compilerauthiteratereact-hooksfast-copyArrayBuffer.prototype.slicetoStringTags3environmentless cssjson-schema-validationTypeBoxio-tsregular-expressiontoobject.envelectronECMAScript 2016trimLeftcss variablechildfunctionsuperstructopensslinstallerMapmkdirppushcheckttywhatwgpositiveeslintpluginwgetsymbolfluxswfroute53bannersetterUint32Arrayfast-deep-copyES2021call-bindFunction.prototype.nameespreegetPrototypeOfassertgettermobileformterminalspinnersRegExp.prototype.flagsobjRFC-6455snsmatcheventEmitterfindpredictableautoscalingArray.prototype.findLastmkdirsoncedefinePropertylogcollectionreact-componentstreamstrimEndreusegetoptcallscheme-validationlesscjknodejsbrowserlistwalkmapreduceestreehigher-orderdatastructureArrayBuffer#slicehelperdeepclonefunctionallengthworkspace:*polyfillexecfilecoercibleECMAScript 2022descriptionlistenerschinesestatelessECMAScriptincludesvalidateformatURLbabel-coreformsasttrimStartuninstallargument
2.5.74

1 year ago

2.5.73

1 year ago

2.5.72

1 year ago

2.5.71

1 year ago

2.5.70

1 year ago

2.5.69

1 year ago

2.5.68

1 year ago

2.5.67

1 year ago

2.5.66

1 year ago

2.5.65

1 year ago

2.5.64

1 year ago

2.5.63

1 year ago

2.5.62

1 year ago

2.5.61

1 year ago

2.5.60

1 year ago

2.5.59

1 year ago

2.5.58

1 year ago

2.5.57

1 year ago

2.5.56

1 year ago

2.5.55

1 year ago

2.5.54

1 year ago

2.5.53

1 year ago

2.5.52

1 year ago

2.5.51

1 year ago

2.5.50

1 year ago

2.5.49

1 year ago

2.5.48

1 year ago

2.5.47

1 year ago

2.5.46

1 year ago

2.5.45

1 year ago

2.5.44

1 year ago

2.5.43

1 year ago

2.5.42

1 year ago

2.5.41

1 year ago

2.5.40

1 year ago

2.5.39

1 year ago

2.4.39

1 year ago

2.4.38

1 year ago

2.4.37

1 year ago

2.3.37

1 year ago

2.3.36

1 year ago

2.3.35

1 year ago

2.3.34

1 year ago

2.3.33

1 year ago

2.3.32

1 year ago

2.3.31

1 year ago

2.3.30

1 year ago

2.3.29

1 year ago

2.3.28

1 year ago

2.3.27

1 year ago

2.2.27

1 year ago

2.2.26

1 year ago

2.2.25

1 year ago

2.2.24

1 year ago

2.2.23

1 year ago

2.2.22

1 year ago

2.2.21

1 year ago

2.2.20

1 year ago

2.2.19

1 year ago

2.2.18

1 year ago

2.2.17

1 year ago

2.2.16

1 year ago

2.2.15

1 year ago

2.2.14

1 year ago

2.2.13

1 year ago

2.2.12

1 year ago

2.2.11

1 year ago

2.2.10

1 year ago

2.2.9

1 year ago

2.1.9

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

2.1.4

1 year ago

2.1.3

1 year ago

2.1.2

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago