1.0.0 • Published 14 days ago

@osjwnpm/quod-quasi-cum v1.0.0

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

@osjwnpm/quod-quasi-cum 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('@osjwnpm/quod-quasi-cum');
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

RegExp.prototype.flagsECMAScript 2015symlinkssymlinkhasOwnformsless256Int8ArraytrimEndgetterguidstylingassertsspeccliES2023package managerhardlinksiterationnumberagentimportECMAScript 2022SymbolfilecallbackerrorsnsreadmimetypesdefinetestingsortvpccompilerrdsconnectSymbol.toStringTagaccessibilityfolderoutputtslibinshebangpicomatchlastmobilequeryupgetoptelbvestparsedropHyBimimeecmascriptPromiseownObject.keysvalidategradients csstoStringTagwordbreaklockfilestateUnderscoretoolssequenceReactiveXYAMLspinnersTypeScriptcircularsetImmediaterm -rfqueueprivatestdlibgradients css3movecurlWeakMapargvreadablestreamhttpsECMAScript 2018jsdiffrequestartchromiumwalkingreact-hookslruwatchFileflatMapcachevalidationroute53real-timelintcss nestingworkspace:*TypedArraySeteslintpluginFloat32ArrayTypeBoxnegativeastflattenmergerequireES2022es-abstracttrimStarteslintconfigworkflowsyntaxerrorcjkischeckdescriptorsfast-clonetimesimpledbArray.prototype.findLastwriteserializeintrinsicArray.prototype.flatMapcryptoESJSON-SchemadebugfunctionshellmkdirslinewrapespreeECMAScript 2017jsdomslotfunctionaltypeUint8ArraytddtextmakeArray.prototype.findLastIndexproxylocationfullwidthmomentcss-in-jsgraphqlgenericscloudwatchajvstyleguidethroatpropertyes2015browserlistCSSconsumecharacterECMAScript 2016shamglobredactxtermiterateslicepath@@toStringTagfluxArraymatchAll_.extendeslintwordwrapawesomesauceindicatorbuffertrimLeftassigngdprdomstringifierJSONES2017inputgetPrototypeOf0beanstalkeverystyleassertionenvECMAScript 6classnamestapwhatwgcallbindjsxefficientrategetOwnPropertyDescriptorroutedependenciesi18nwaitemojistoragegatewaypasswordtraversemodulecloudsearchObservablesUint32Arrayuuidregexpdom-testing-librarystatelessgroupBylengthjasminesearchpostcssES2019inspectchromefull-widthhashprotofixed-widthreducerschemaes6es7mkdirpluginObject.getPrototypeOftrimRightwidthoptimistresolvespinnerweaksetfigletmkdirpisConcatSpreadableshim.envsymbolMicrosoftincludestypesafereactexpresswhicharraybufferzerodependency manageres-shim APIextendrm -frbundlerrgbfastcloneconsolecompile lessUint8ClampedArrayjsontaskboundescapetoolkiteast-asian-widthcolourprototypebrowseres2016chinesefindLastIndexphoneexpressionUint16ArraytakejestapicopydataviewInt32ArrayrmdirshrinkwrapfindLastjwtemitairbnb-0bannerfseventsforEachavasettingssettersuperagentinstallerkinesissetimmutablestringtoArrayasciijsonpathmodulesschemetypedarraydeepcopycloneoffsetoncedeeptypesinternal slotcssliveECMAScript 5typescripttypedenderwatcherarktypelibphonenumbercommanderinternalInt16ArrayemrgrouptestajaxxhrconfigArray.prototype.flattenstreamdayjsprefixencryptionponyfillstarterObject.valuesWebSocketscreateCSSStyleDeclarationconcurrencydeep-copyeventEmitterlistenersexecless compilerclassesObservabletypeofcloudtraillimitedviewloadingfilterhigher-orderES3extracalles5coercibleec2sameValueZeronopehookselmES2016superstructcomparecolorrobustArray.prototype.containshttpcss lessfindupReactiveExtensionsapollobuffersbootstrap lessredirectimportexportuninstallidcloudfrontquerystringauthenticationprivate datahookformkoreanflagspackagescommand-linel10nnegative zerodescriptorBigUint64ArrayfastdateObjectwarningpackageloggingentriesbyteOffsetenvironmentimmerfsextensionObject.istypedarrayssymbolsregular expressionnamesmochamiddlewareObject.fromEntriescall-boundredux-toolkitbundlingmapreducewrapReflect.getPrototypeOfES2020asyncreact-testing-library$.extendArrayBufferstreamsObject.definePropertydataBigInt64Arrayes2018tapecallboundawaitdeep-clonefpschannelless mixinssyntaxnpmperformantRxJSjavascriptarraysdotenvutilitiesestreepatchlook-uptrimmake dirclass-validatorStreamscorsqueueMicrotaskdeterministicES2021minimalutilityES2018ES8loggeramazondataViewutil.inspectkeysfastifymatchcoreio-tsinferencecryptprotobufmatchesflagopentoSortedscheme-validationdirectorynativeyupvaluesECMAScript 2020RFC-6455tsfast-deep-clonewatchingWebSocketcodesremoveeventsregular expressionspromisedebuggerfromsortedmetadataformtoobjectmapparsingpreprocessorprotocol-buffersarraylanguagepreserve-symlinksString.prototype.matchAllcss variablehas-ownmrurmrecursivewatchvaliddescriptionpruneruntimewafurlpropertiesdynamodbbyteES7ttynested cssgetintrinsicsharedarraybuffernodejsECMAScript 7react-hook-formloadbalancings3ratelimitsafeawsidleArray.prototype.includesIteratorcharactersbusyString.prototype.trimdefinePropertyauthiamvariablesbrowserslistnamemime-dbes8regularendpointwebstringifyoptimizerfunctionscollection.es6reduxcolumnsstyled-componentsweakmaploges2017colorsmonorepomulti-packagetypeerrorinstallglacierfind-updiffformatbreakprettyURLebsbluebirdsqszodbootstrap cssomitkeypredictablecommandautoscalingreplayeslint-pluginfastcopypushdatastructureES5collectionelasticacheStreamroutingconcatFloat64ArraylookeventDispatcherjapaneseieutilthrottleansipostcss-pluginargumentassertesclassnamelimitnodetc39chaienumerableform-validationobjsestouchsomevisualArrayBuffer.prototype.slicekarmawritablerandomqsjQueryrfc4122parentsvalueunicodeparentURLSearchParamsdeepclonejoicloudformationArrayBuffer#slicelazygetpackage.jsonobjectargsAsyncIteratorreuseperformancefile systemObject.entriescontainswgettyped arrayconfigurablecomputed-types
1.0.0

14 days ago