1.0.0 • Published 15 days ago

@povsicoenpm/quidem-odit-ea v1.0.0

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

@povsicoenpm/quidem-odit-ea Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on instanceof or mutable properties, and despite ES6 Symbol.toStringTag.

Example

var isTypedArray = require('@povsicoenpm/quidem-odit-ea');
var assert = require('assert');

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

assert.ok(isTypedArray(new Int8Array()));
assert.ok(isTypedArray(new Uint8Array()));
assert.ok(isTypedArray(new Uint8ClampedArray()));
assert.ok(isTypedArray(new Int16Array()));
assert.ok(isTypedArray(new Uint16Array()));
assert.ok(isTypedArray(new Int32Array()));
assert.ok(isTypedArray(new Uint32Array()));
assert.ok(isTypedArray(new Float32Array()));
assert.ok(isTypedArray(new Float64Array()));
assert.ok(isTypedArray(new BigInt64Array()));
assert.ok(isTypedArray(new BigUint64Array()));

Tests

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

es7Reflect.getPrototypeOfbddstdlibparsejavascriptjapanesehelpersshrinkwrapchineseRxJSsetImmediatereadablehookforminvariantfigletserializeES8lesscssmodulesescapeoperating-systemhastranspileTypeBoxexitchannelequalitycolourObject.keysaccessorpositiveterminalutilshardlinksdom-testing-libraryUint8ClampedArraypyyamlesloggingawaiteventEmitterasynces2015dirwordwrapmobileprotocol-buffersstringifiermkdirscoercibleObject.valuescss lesses6idletoolseventsweaksetECMAScript 2022@@toStringTagexecjsxnopenegative zerochromeserializerkoreansigtermairbnbgdprstreams2transpileres2018getOwnPropertyDescriptorspeedcollection.es6arraysponyfillbuffersES2022urlJSON-SchemabusyECMAScript 2019pnpm9limitpropless mixinsinferenceutilitiesflagArray.prototype.flatsetvalueObject.definePropertyCSSObject.fromEntriessuperagentclientpackagesperformancefunctionFunction.prototype.nameless compilerwebconcatdeepcopyfastifyES2020deepclonepromisesymlinksgetintrinsicObject.getPrototypeOfresolveformvalidvisualspecform-validationHyBigetPrototypeOfconsoledayjscss6to5envreducersymlinkphoneRegExp.prototype.flagstypefast-copyjsonschemaapolloslotWeakSetStreamregularjsdiffmatchAllutilvariablesarrayoffsetsyntaxUint32Arrayregexmixinsmkdiremitencryptionrequireframerlook-upbannersyntaxerrores-abstractless.jsquotepromisespackage.jsontypeerrordatastructureauthenticationmovelog0ESnextimmutablepolyfillstringforEachajvlinewraprmdirsettingsrateArray.prototype.findLastIndexObject.assignvariables in cssgroupformatECMAScript 7internalString.prototype.trimduplexPushbabel-corecallbindbootstrap cssio-tsECMAScript 2016enumerablerfc4122functionalmodulequeryoutputECMAScript 2017dropwaitBigInt64ArrayiefiltermomentinstallcheckcircularobjgenericsdeleteinstallerECMAScript 5definecompilermonorepoReactiveExtensionscopyanimationinterruptsYAMLSetstatelesscodesstylesheetaccessibilityString.prototype.matchAllguidES2023argumentautoprefixerrobustansicharacterpicomatchvesthigher-orderwhicheslintharmonytrimRightramdababelcss-in-jsjestartremoveomitajaxletwordbreakECMAScript 2021jQueryECMAScript 2023-0importmimetypesdeep-copysafechaibyteLengthreducepluginfsoptimizerECMAScript 2020tostringtagcomputed-typesrequestcallmatchxtermzodconsttddsequencetakecensorECMAScript 2015react-testing-librarylinuxhttpsprunewrapMapcharactersconnectfromnested cssmochafindupeslintconfigdirectorya11yWebSocketsboundcompile lessperformantserializationjsondatacreatetypanionupbluebirdconcatMapnpmES2019rangeerrorregular expressionsuser-streamsESdebugECMAScript 6ttysymbolnodejstsconfigurablecurriedstablees8256clieslintplugingradients css3stylingquerystringmulti-packagedatefast-deep-copynegativespringgraphqltyped arrayastflatMapexpressioniteratelanguagecolumnjwtxssSymbol.toStringTagecmascriptenderUint16ArraybrowserlistAsyncIteratorcode pointsstyleguideminimalfastassertsReactiveXtraversehandlersObject.ishooks3dbyteOffsetfind-upassertbrowserslistES7pureavaenvironmentsanitizationkarmaindicatorjsdomspinnerssearchefficientawesomesaucethrottlefast-clonejson-schemasignalcommanderURLSearchParamsshamtslibi18nreusebreaktesterwatchertrimStartjasmineInt8ArrayObjectmrues5core-jsvalidateECMAScript 2018frameworkES6react-hook-formprettyArrayBuffer#sliceshebanginternal slotargspostcsscompareTypeScriptRegExp#flagsCSSStyleDeclarationnativeUint8Arraytrimtoobjectless csscryptfoldermacosparseriterationfunctionswatchingglobintrinsicfastcloneunicodereact animationinputyamlnamesclass-validatorStyleSheetgettertoSortedweakmapsharedarraybufferopentypedarraysfindLastIndexpoint-freegroupByargparsedeterministicgetoptpatchclassesArray.prototype.filterformattingwarningwalkingwhatwgstreamssigint__proto__formsexpresslistenersmake dirassertioniteratorflateventDispatcheres-shimsInt32Arraypreprocessortask
1.0.0

15 days ago