npm.io
1.0.0 • Published 2 years ago

@ryniaubenpm2/sequi-similique-nihil

Licence
MIT
Version
1.0.0
Deps
24
Size
18 kB
Vulns
0
Weekly
0

@ryniaubenpm2/sequi-similique-nihil Version Badge

github actions coverage [![dependency status][5]][6] [![dev dependency status][7]][8] 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('@ryniaubenpm2/sequi-similique-nihil');
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

Keywords

argparsekinesisES5cachefses7Symbol.toStringTagfastifycompareextendkoreaniterationes-shimsopensuperstructelectronESspeed__proto__getPrototypeOfbyteLengthopensmapcontainsreact-testing-librarydeepcloneInt16Arrayperformancenamesprotobufthroatarrayslinkprunepicomatchreact-hook-formformsgetterrgboutputbcrypttypesafemodulesbindquoteStreamshamec2dotenvglobalstoobjectWeakMaptoStringTagasyncsyntaxMicrosoftfpssettingscloudtrailpatchjapanesesameValueZerofetchwriteautoprefixerWebSocketsmomentmacoswritablebusylistenersgetintrinsicObject.fromEntriesdatastructurelibphonenumberESnextArrayBuffer.prototype.sliceuuidArrayBufferbeanstalkimportexportWebSocket256visualsignalcensorstringifyTypeBoxcliexit-codeTypedArrayelasticacheinvariantloggingisConcatSpreadablesearchrestfulmake dirpackage.jsontrimLeftenderextensionbyteOffsetnametrimStartinputES2016MapeslintpluginpromisesglobalES7Symbolstdlibtypeautoscalingindicatorparserframeworkurlsfast-cloneJSON-SchemasetPrototypeOfmime-dbequalslotcore-jsshelli18nregular expressionECMAScript 5warningimmerrequestdataviewmatchvaluesuninstallform-validationshrinkwrapexpresswhich[[Prototype]]iterateECMAScript 7fluxoptimistmergeeventDispatcherchinesefindupIteratorbatchstylingzodconfigl10nerrordependenciestostringtagdescriptorwaitpersistentomitdomlogtrimEndawsxdg-openbrowserslistcodestrimassertqueuestreams2walkingwordwrapredactremoveprogressES8ArrayBuffer#slicegetsafeebsArray.prototype.flattenidReactiveXobjectvalidationbootstrap cssvarsterminalparsestreamcall-bindes5fastcloneeventEmitterxtermstatusnpmiammkdirpwatchingrm -frserializerdropqueryasciitesterECMAScript 2023clonewalkmimeRxinternal slotgdprworkflowmakestyleguidexhrgradients css3Uint8Arrayprotoexitdeterministiccall-boundajvpipeECMAScript 2022classnamees6joicompile lesscoercibleeast-asian-widthexecprivateassigncolourwindowsminimallaunchjsxObject.keysmoduleinferences3formatlesscssconcatduplexless.jsestreeeslint-pluginfilterfindLastspinnersrestdependency managerendpointtouchfunctionES2017astdom-testing-libraryjQueryES2022typescriptsetImmediateresolvewatchpasswordcurljestvalidassertsinterruptsObject.assignsymlinkjsdiff_.extendPromisetraversecloudsearchPushsigintmkdirslintsuperagentdefineURLSearchParamsserializeparentsbufferes2018negative zeroStreamsjsbannertakeconcatMapcryptonopehotformattingfastcopyECMAScript 2016$.extendutilmixinstestinglazyratelimitincludestypedarraymatchesObject.isfixed-widthhashworkerlessregexES3performantArray.prototype.containsparsinghigher-orderredux-toolkitfind-upcryptsigtermfast-copyInt32ArrayHyBibytedynamodbString.prototype.trimbreakstartstylesconnectpropObservablesutil.inspectdebugformstringifierlinewrapvaluehelperscollectionECMAScript 2019Array.prototype.flatMapcomputed-typestaskES2023cmdreadcopyes-shim APIqueueMicrotask-0robustwafwrapxdgECMAScript 2020typeofshimmapreducesymlinksdataavatypeerrorutilitiesintrinsicwidthObject.definePropertybootstrap lessprivate dataescapelengthsqscommand-lineenvironmentprettyqskeysECMAScript 2021throttleassertionstyled-componentsidleencryptionproxygenericsfigletes@@toStringTagfromfilefast-deep-clonereadablerouterdeepRegExp.prototype.flagsnodejssignalsstablestreamscssmetadatacss variableoncedataViewwatcherflagcreateECMAScript 6mkdirgroupByclassesschemaUint8ClampedArrayrecursiveECMAScript 2018flagses2017deepcopyemojitoSortedpackagesfile systemstoragegatewayrandomwebsitehttpArray.prototype.findLastIndexsequencesharedarraybufferFunction.prototype.nameECMAScript 3jsonoptimizertrimRightless compilersharedfunctionsstylesheettoolkitchildBigUint64Arraymiddlewareiscommandamazonstylearrayreal-timesortedupmobilevariablesirqstarterweakmapopeneres8prototypeschemeauthkarmaemrUint32ArraylockfileexpressionArray.prototype.filterUnderscorecss nestingconcurrencyzeroarktypeawaitcjkcloudformationcharacterreducerES2015hasOwnPropertyArray.prototype.findLastcloudwatchansiregular expressionschromiumargumentsemittestiteratorchromematchAlltimeReflect.getPrototypeOfArrayprefixECMAScript 2015workspace:*fast-deep-copyimmutablecode pointspolyfilloperating-systembrowsermulti-packageequalitysesInt8ArraywgetsymbolsenumerableextradatefastArray.prototype.includesreactregularrmdirYAMLttysimpledbrm -rfyamlpreprocessoraccessibilitycallboundhasOwnguidnodeclassnamesshebangpathmonorepovalidatedescriptionRFC-6455limitJSONtermES2018bluebirdless mixinscallbindlanguageObjectrapidcheckjasminepredictable