1.0.0 • Published 16 days ago

@crabas0npm/repellendus-illo-vero v1.0.0

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

@crabas0npm/repellendus-illo-vero 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('@crabas0npm/repellendus-illo-vero');
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

WebSockethttpyamlJSONassign6to5es-shimsArrayBuffer#slicefilejson-schema-validatorwindowsInt8ArraytapdatalogpersistentexectakegetPrototypeOfECMAScript 2020patchuprecursivetrimfilterregular expression_.extendjwtMapsharedarraybuffernegativelengthunicodeconcatfull-widthremovebrowserlistBigUint64ArraysyntaxerrorclassnameexitdateES7pushvaluemomentpicomatchgradients css3writewatchFilebcryptsignalwaittools__proto__pyyamlwatchingpurenamedeepUnderscoreposebatcha11ygesturesjestprunemergevisualtyped arraytty$.extendcollection.es6RxJSidlewidthes2016install3derror-handlingdefineserializersymlinksmetadatainferencecompilerutilitygetintrinsicbabel-corecss lessfixed-widthtimeStreamlastavauser-streamsArray.prototype.findLastIndexchromiumArray.prototype.containsscheme-validationgenericsinternal slotCSSStyleDeclarationhasOwnjson-schemagetOwnPropertyDescriptorminimaljsonschemapolyfillreusetoobjectwalkinges8ajaxpopmotiontoStringTagchannelworkspace:*ECMAScript 2019IteratorenvtacitObjectECMAScript 2022reducerxhreventEmitterYAMLcall-bindMicrosoftclass-validatorRxSymboltypescriptdependency managerFunction.prototype.namewritablechromeeslintconfigcoreInt16Arrayredactsharedtestreact poseSetArray.prototype.flatprocessflatMaptoSortedio-tscode pointsmake dirtranspilekorean-0queuewebvalidhttpsmkdirsspringpipeArraymatchesjoiextensioneventsbrowserslistinvarianttypanionECMAScript 2015mimetypesutilstatelessArrayBufferserializationrfc4122deletestyleredux-toolkitpromisespropertycurriedexpressfpcommanderastvaluesnamescompareURLSearchParamsletpositiveUint8ClampedArrayqsdeepcopyhashasyncreduceerrorinstallerframeworklinewraprmdirFloat64ArrayECMAScript 2023css variablefslesscssawaitECMAScript 3typeofreadsettslibmruairbnbwarningserializesortedperformantpackagefast-clonecommanddirectoryimportarktypeutilitiesnodejsdirbluebirdcss nestingcurlintrinsicpasswordWeakMapsafefast-deep-cloneECMAScript 7coerciblesearchreadableelectronsigintpoint-freeeslint-pluginRegExp.prototype.flagsfastifyreact-testing-librarystringdescriptorsvalidatoruninstallmobilesetImmediatees2018byteOffsetRFC-6455ES2016propertiesmiddlewarewgetinterruptsPromiselinkcollectionartObservablevariables in csskarmastreamrgbstabletelephoneoptimizerlintwrapflagObject.entriesstatusdayjs[[Prototype]]variablesrateregular expressionsloadingthrottleprogressObject.getPrototypeOflibphonenumber
1.0.0

16 days ago