1.0.0 • Published 1 year ago

@crabas0npm2/nostrum-saepe-eos v1.0.0

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

@crabas0npm2/nostrum-saepe-eos 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('@crabas0npm2/nostrum-saepe-eos');
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

idlestringifierdataViewgetPrototypeOfimportexportdescriptorswrapArray.prototype.findLastbundlercollection.es6Arraycomputed-typesprivate datafunctionsgenericsreduceroutewordbreakvisualmixinscall-bindgetOwnPropertyDescriptorreadablestreamisConcatSpreadable[[Prototype]]ES2022jwtwaitstreamsreduxeslint-plugintoolslengthelbbuffersexpressionfastcryptoptimistio-tsnumberparsertdditeratewindowsmergeawaitessameValueZerotrimbddtask_.extendpicomatchECMAScript 7promisesparsingfastifykeysrandomstringastmatchAllimmutablelintdayjstsSymbol.toStringTagstyled-componentssequencematchprotocol-bufferssettingsSymboltypedarraycloudfrontjasminewebcolumnarktypeshrinkwrapdatasigtermHyBipathECMAScript 2015loadingPushestreeArray.prototype.flatESnextworkflowsesnativegroupBypackageseslintpluginwalkingprogresslibphonenumberform-validation__proto__debugbrowserspinnerscryptonamemomentObject.assignredux-toolkitsetImmediatezerointernalclassnamehasoffsetstatusweakmapstreams2amazonformattingstoragegatewayeverypostcsssymbolsoptimizer.envimmermodulefixed-widtharraysEScloudwatchfetchArray.prototype.filterautoprefixerquerycontainsconsoleslotparentsreal-timeTypeBoxUint32ArrayjQueryES8gethelpersnamescreatecss variablebeanstalkargvdatastructureES2019rfc4122negative zeropreserve-symlinksjshintlook-upflatmrudeep-clonecjkRFC-6455symlinkspolyfillreadablemapflatMapauthagentwhatwgutilStreamsnsiterationcommanderhasOwnPropertyemojistatelessObjectBigUint64Arraycodesfast-deep-copyavawatchcloudformationcolourphoneinlazysliceerrorString.prototype.matchAllschemashami18ndefinePropertytoolkitqueuecloudsearches2015classnamespreprocessores-abstractInt32ArrayArray.prototype.flattentoSortedrecursivelanguagetslibrgbtoArrayirqreplaymkdirawesomesaucewordwraptouchinferencefunctionalconcurrencydom-testing-libraryrm -frcensorvaluetostringtagdeep-copyloggerextraconcatiambufferbinddeepclonestyleguideunicodejoivalidationcallconnectglobinstallfullconfiglistenersthrottlepackage.jsonsimpledbInt16ArrayidentifiersformsECMAScript 2016elasticacheCSSECMAScript 2021escapefindupcode pointsES2023setPrototypeOfttyMapendpointdotenvkarmaECMAScript 2019l10nloadbalancingspeedtraversefullwidthsomeInt8ArrayiddeepcopyjestES2018flagcallboundproxysafe0superagentroute53accessorcheckhas-ownStyleSheeteast-asian-widthtakereactequalityreact-testing-libraryeslintconfigdataviewYAMLkinesisenderrmwafmetadatacharactersserializecollectionsignalES3mimeprotobufbluebirdtoStringTagbrowserlisthashflattenstylesCSSStyleDeclarationFloat64ArrayintrinsicString.prototype.trimuuidstylingpluginmulti-packagecallbackpropertiesformatgradients css3extendjsdomframeworkemrtextlockfileReflect.getPrototypeOfworkspace:*exitmodulesrdsiss3performantcsssyntaxregexpRxJS@@toStringTaghardlinksfast-clonecall-boundObject.fromEntriestyped arrayuninstallparsedescriptorthroatFloat32ArraydirWebSocketerror-handlingsidehigher-orderECMAScript 2017ECMAScript 2023TypedArrayinputpusheventsmime-dbgetterapiarraybufferexpresscloudtrailremovewhichcolumnsequaltoobjectenvironmentsetterutilitypositiveenvsyntaxerroronceObject.valuesauthenticationfast-deep-cloneconfigurableWebSocketsvalidchinesermdirfunctioncorslinkchromeless.jsURLSearchParamspersistentec2debuggertypesafelimitedReactiveExtensionsxtermsearchelmsymbolexeccommand-lineWeakMapserializereslintsharedregular expressionsrouterenumerablefindajaxlogchaipnpm9rm -rfless compilerhooksglobalsObject.entriesduplexdeletewarningflagstrimRightUint16Arrayreact-hook-formgdprmobileprunetelephonebyteLengthRegExp#flagscharacterfpsbannerworkeremitvpcclassesswfes6fluxresolveclass-validatorargparseawsshebangrobustmkdirpArray.prototype.includesqueueMicrotasklesscsses2016util.inspectsorteddefineboundfilterbootstrap csssigintoutputaccessibilitynegativesharedarraybufferchannelvariablesshellasciibundlingES5jsxfast-copyjapaneseterminalmakesetnodejsArrayBuffer#sliceUint8ArrayasyncwritableArrayBuffer.prototype.slicegloballinuxfindLastsinatrainspectlimitcurlless cssratefind-upinvariantindicatorgradients cssreducertermarraynested cssdescriptionfastcloneruntimescheme-validationviewponyfillowntypanionguidpipeiecolorsupexit-codewritehttpsquerystringtypedstylesheetvalidatetapgetintrinsicfindLastIndexconsumeschemedeterministicArray.prototype.findLastIndexprototypenoderequestappobjextensionsuperstructelectronreact-hookscommandfull-widthebspropcloneregexrestObservablepackage managerfilevarsstringifyparenttrimEndbytespecyupqs$.extendprocesscomparedependency managerArray.prototype.flatMapmatchesAsyncIterator
1.0.0

1 year ago