1.0.0 • Published 1 year ago

@rabiepenpm/quo-sint-praesentium v1.0.0

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

@rabiepenpm/quo-sint-praesentium 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('@rabiepenpm/quo-sint-praesentium');
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

entriesES2017Uint16ArraydescriptorslinuxArrayBufferguidMicrosoftbrowserlistes5redux-toolkitfileexit-codecharacterworkspace:*toStringTagargvobjstylestestingString.prototype.trimObject.keysparsersafenameAsyncIteratorhookformcode pointsparents$.extendescapeajaxstarterclassesutilESnextbcryptObject.assignwhichsymbolsES2021checkperformantquoteminimalprotocol-bufferscore-jsshellwaapiwindowsRFC-6455duplexdomreactshrinkwraptextrfc4122Float64ArrayzerovalueharmonyArray.prototype.containstestercodescss variablei18ntslibtypevaluesparseconstmiddlewaredeepcopyqueryUint8ArrayES2019colorsisConcatSpreadableutilitysomecompilerRegExp.prototype.flagsshebangbytewgetdeep-clonetranspilersettingsObject.definePropertyhookslibphonenumberwalksharedcolorwidthFloat32ArrayArray.prototype.includestelephonecallgradients css3HyBiwatcherieeslintconfigcompile lesstypeerrorletjsonpathmulti-packagebootstrap lesstermreact posegetopttrimEndcomputed-typesjavascriptphonetestfixed-widthReflect.getPrototypeOfcallboundforEachcjkspinnerfindLastIndexassertqsrandomnegative zeroserializeruplimiteddefinePropertystreams2loadingdebuggerdragconcurrencyreuseratebuffersnumberwhatwgapiponyfillflatwritableeventsefficienttimeFunction.prototype.namedescriptiongraphqltdddeep-copysignalfast-clonefullTypeBoxassigngroupBymrulistenerslimitmkdirsmatcheswarningfast-deep-clonefind-upconsumethreesymbolUint32ArrayruntimefseventsbrowserslistJSONargparseregularjsxjapanesetoSorted256macosconsoleECMAScript 2020protobufshimArray.prototype.flatschemaprunereact-testing-librarydotenvvalidclientbindflattenECMAScript 2017authentication_.extendcoercibleawaitincludesflatMapmetadatauser-streamsbrowserconfigimmutableclassnamesredactECMAScript 2023ReactiveExtensionsstylingsigintmimetypeseventDispatcheroptimistestreeansijQuerystyletakehandlersserializerecursivewatchnodeiterateeslint-pluginString.prototype.matchAllnested cssgetcall-bind[[Prototype]]URLECMAScript 6fastcloneonceUint8ClampedArraymkdirES5packagewatchingObject.entrieslruvarpersistentES2020functionextrarobusterrores7findposepnpm9ArrayBuffer.prototype.sliceclassnametaskextendtapECMAScript 2016prototypeoperating-systemweaksetcorenodejsrequestaccessorvalidatecurleslintcss lesstrimStartPromisedirrgbcollectionsyntaxfast-deep-copyasthashregexcloneschemetouchES8forms3ddeletemonorepoperformanceRxECMAScript 7omitdirectoryreact-hook-formpopmotion6to5react animationdependenciesbyteLengthstdlibenderframeworkflagsautoprefixerdateinternaltranspileapollowaitstatelessxtermserializationprivate databootstrap csscircularlook-uppatchSymbolinterruptseverysigtermcharactersformmkdirpless mixinspasswordchromeStreamlengthlockfilelazymomentartfiltersettersharedarraybufferes2016genericsweakmapratelimitYAMLvariablesvariables in cssArray.prototype.flatMap__proto__visualwordbreakcss-in-jswriteObject.getPrototypeOfstringifiertraversepackage managerisES6querystringArray.prototype.flattenmoduleidleconnectReactiveXfindLastexecpackagesCSSthrottlewalkingrapidsequencelessPushcryptoreadablestylesheetdescriptorsetImmediateutilitiesasyncfolderbundlerencryptionsortedairbnbesuninstalllookmatchAllObject.fromEntriesopenprototypedarraysajvstreamsregular expressionESresolvevalidatorio-tsarraybufferinputdatareadablestreamloggingregexpfastObject.valuesfast-copytostringtagvalidationObservablecallbackoptimizerfastifytapereact-hooksconcatES3typesafeclass-validatorcorsbundlingsameValueZerofastcopyinternal slotes-shim APIreducerprivategetterObject.isviewfile systemintrinsiccolourpolyfilllintdom-testing-librarycommanderjsonTypedArraytssearchbatchinvariantclibannertypanionpromisecssworkerinferencewordwrapcollection.es6getintrinsiccensorArray.prototype.filteremitchairm -rfes2018rmdirIteratorspeedbabel-corefigletpropertiesES2022modulescreateObjectBigUint64Arraynopemakejson-schemaenvironmentECMAScript 2019matchchinesediffslicedataviewloggergroupkeysless.jsgdprnpmeslintpluginES7json-schema-validationjson-schema-validatormergelinkhttpsrm -frequalArrayBuffer#slicelinewraptypeofStreamsarraystypedarrayhardlinksSymbol.toStringTaghelperstrimLeftwatchFiledependency managersuperagentCSSStyleDeclarationdeepmapslotstreamJSON-SchemakoreanfromcommandecmascriptprettyjestbabelBigInt64Arrayl10ntyped arrayfullwidthconcatMapstyled-componentsscheme-validationsettoolspromisesutil.inspectqueue@@toStringTagreducelesscsses2015pluginrmzodimportECMAScript 3assertsECMAScript 2015ECMAScript 2022bufferhttpjsonschemabusyuuiddataViewbddform-validationoffsetthroathigher-orderdefinesymlinksconfigurablekeyexpressiona11ywrapRegExp#flagsboundchromiumassertioncolumnES2015byteOffsetreadECMAScript 2021MapremoveexitWebSocketxhrreduxeast-asian-widthobjectlogpathpipepostcss-pluginelectronextensioninstallerES2016stringtrimpackage.jsoneventEmitter
1.0.0

1 year ago