1.0.0 • Published 1 year ago

@devtea2025/magni-maiores-magni-magnam v1.0.0

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

@devtea2025/magni-maiores-magni-magnam 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('@devtea2025/magni-maiores-magni-magnam');
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

form-validationpersistentidgroupByreplayinkoreantypanionObject.valuessidemapreducerapidwatcherESjsdiffproxyregular expressionargparsepromisesthroatmacosgetintrinsicArray.prototype.includesfrombusyObject.keysgetOwnPropertyDescriptoriterationcloudtrailsomesliceObject.isarraybuffercss nestingelmparenttaskownidentifierswafautoscalingperformantcss lesswebECMAScript 6bluebirdjssymlinkcreateglobalsshebangelasticachewidthshimdependenciesless.jsArray.prototype.findLastIndexqueueMicrotaskbrowserIteratorjsxdataVieweverydefinePropertyvestArray.prototype.flatrobustcommand-lineloadbalancingfunctionsqueryES2016propObservablesqueuefast-deep-copyfindbeanstalkflagsvarsamazonpackageauthenticationforEach256es-shimsTypeBoxURLsameValueZerowatchfull-widthArray.prototype.filterebsarrayssettingsemojiauthinspectsigintsesstyled-componentsponyfillstylestrimStartapiparserless mixinssortedtrimEndbddfigletargsspeedserializepreserve-symlinkswatchingECMAScript 2022higher-orderttysimpledbsetPrototypeOfjshintcharacterstoArraybcryptfetchAsyncIteratorhelpersbyteObject.entriesjsdomspecInt8Arrayes2017propertiesloggingstringupinstalleremrgraphqljsonpathshelltypeerrorstreamsio-tsfastifyES3ecmascriptcloudfrontnamesendpointjQueryrequireArray.prototype.findLastreactpathnopebrowserslistWebSocketsObjectstatelessgenericsbootstrap cssajvpackage.jsones8getoptstateshamfpscompile lessrmcharacterstreammkdirpinvariantglacierreducerInt16Arrayl10nloggerpackage managerECMAScript 2016nativewhatwgeslintestreerm -rfiteratoravadrop.envmakea11yWeakMapguidparsingcode pointsES6deep-cloneSymbolaccessibilitydom-testing-libraryyuppostcss-plugindependency managermovelockfileelblistenershookformresolvegloballookopenprogressisReflect.getPrototypeOfstablelintwindowsserializerPushcolorflatschemetoSortedfunctionformathasOwnstringifyES8classnamessuperagentjsonvariablespipestylingpromiseastECMAScript 2015setterxhrinterruptstrimasyncsigtermSymbol.toStringTageslint-pluginstylesheetfastcopyUint8ClampedArrayes6pluginratelimitassertsdeletebyteLengthutilitiescss variableemitmapzeroes-shim APItouchclass-validatorES2018signalnegative zeroES5importexportdeepclonescheme-validationjapaneseUint8Arraymime-dbcssnested cssURLSearchParamsawaitchecki18nbrowserlistRxJSkinesiseventsarrayreadmatchesperformancematchclassnameloadingformattingaccessordirjoilinuxvalidateES2021fast-deep-clonekeyfast-clonechromiumuninstallredactcolorsduplexframeworkfileremovefastcloneisConcatSpreadableStyleSheetget_.extendserializationboundwatchFileimmutableescapemodulees2015ES2017real-timemrutypeofhasindicatoriamutilitybannerES2023consumermdirdatecensorthrottleagentzodmerge0TypeScriptencryptionnpmroute53chaishrinkwrapdotenvsyntaxerrorgradients cssclassesvariables in csstypedarrayquoteansibufferstapestyleguidepyyamldiffomitquerystringxtermflatMapsharedarraybufferenumerabledescriptorObject.getPrototypeOfrateexpressionless cssconfigirqconcatfilterrestfulcontainsECMAScript 2023gdprfullBigUint64ArrayES2022viewconcurrencyutil.inspectdebugsharedargumentexitECMAScript 2017signalspnpm9bufferJSON-Schemaprivate dataclientcurlfindupregexpBigInt64Arraytraverseclonefast-copyoptimistrequestsafeworkerreact-hooksqswordbreaklook-upArrayBufferutilstyleeslintpluginoperating-systemArrayBuffer#slicehttpsbreakcjkcircularpostcsssequencefind-uprandomArray.prototype.flatMapRegExp#flagsdefineswfreact-hook-formdataviewYAMLtypesexit-codePromiselogRegExp.prototype.flagsincludesdatastructurereduxdescriptorsidlecallbackfixed-widthprotocol-buffersArrayfluxdescriptioncorejestWeakSettoobjectreduceclicolumnuuidpatchsymbolsenvironmentses7propertyfunctionalnodecloudwatchexpresslibphonenumberworkfloweventDispatchercorsHyBiECMAScript 2021predictableObject.fromEntriesargvfullwidthtoolkitmonorepovalidationtslibextensionJSONsymlinks[[Prototype]]privateStreamscrypttypehooksdynamodbhottyped arrayiteratesyntaxlinkbindlastcollection.es6TypedArraylanguageeventEmitterec2CSSStyleDeclarationnameasciihas-owndebuggermiddlewaretextoptimizerfseventsESnextES2020batchmimeawesomesauceerror
1.0.0

1 year ago