1.0.0 • Published 18 days ago

@rabiepenpm/esse-laborum-dolorem v1.0.0

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

@rabiepenpm/esse-laborum-dolorem Version Badge

dependency status dev dependency status License Downloads

npm badge

Robustly get the length of a Typed Array, or false if it is not a Typed Array. Works cross-realm, in every engine, even if the length property is overridden.

Example

var typedArrayLength = require('@rabiepenpm/esse-laborum-dolorem');
var assert = require('assert');

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

assert.equal(1, typedArrayLength(new Int8Array(1)));
assert.equal(2, typedArrayLength(new Uint8Array(2)));
assert.equal(3, typedArrayLength(new Uint8ClampedArray(3)));
assert.equal(4, typedArrayLength(new Int16Array(4)));
assert.equal(5, typedArrayLength(new Uint16Array(5)));
assert.equal(6, typedArrayLength(new Int32Array(6)));
assert.equal(7, typedArrayLength(new Uint32Array(7)));
assert.equal(8, typedArrayLength(new Float32Array(8)));
assert.equal(9, typedArrayLength(new Float64Array(9)));
assert.equal(10, typedArrayLength(new BigInt64Array(10)));
assert.equal(11, typedArrayLength(new BigUint64Array(11)));

Tests

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

accessorutilitiesECMAScript 2017Reflect.getPrototypeOfless csseditorsyntaxcssopenurllanguagequeueMicrotaskFloat64Arraypicomatchdom-testing-librarybundlingchromeformstatusiteratorfindLastIndextypeinstallconcurrencydebuggeriterationmulti-packageObjectrmES5watcherECMAScript 2023full-widthsymlinksprototypemovelinewrapbuffercommand-lineRxJSwaitmiddlewarepersistentfolderparsemergehttpscallbindasynctapArray.prototype.includesspringassertgestureseslintpluginredux-toolkitoptimizerexitsetObject.valuescolourequalargvstreams2Underscorexssnested cssclonerapidspawncoerciblefast-deep-clonecss-in-jsdeephasOwnregexpmime-dbdomes2018emojikeyphonesanitizationcolorscollectiones-shimsstreamsECMAScript 6everyperformanceWeakSetlinkframeworkjsdifflimitfastclonejsxStreamredactRxdebugsignalbyteLengthexesetPrototypeOfconcatMapsigintcolumnjsonschemasortedevents.envES2016tasktrimEndwalkingoutputdefinedirreact poseserializerObject.entriescurriedURLobjcryptopoint-freeimmerbrowserimmutablemetadatatypedarraysObject.assignvisualcommanddatastructurefseventsschememimetypespopmotionES2019websitetschecksameValueZerobyteOffsetYAMLJSONxhresduplexexit-codeartpolyfillxtermtoArrayArray.prototype.findLastIndexdeepcopyserializeframeres2016installercode pointssanitizeinputbluebirdObject.keystrimexecMicrosoftArrayBufferenumerableESpackagesmodulesairbnbmonorepopromisethreeInt8ArrayweaksetstructuredCloneES7linuxArray.prototype.findLastbcryptautoprefixerdataviewratelimitsigtermlaunchdependenciesoptionjQuerycachereact-hook-formtoolkitspeedutilstringcore-jsauthenticationpassworddatasymlinkmoduleenvironmentchildinferencees8viewpackagewordbreaksafeansimimedropexecutableeventEmitterprivatesyntaxerrorawaitwhatwgletl10ntyped arraydiffPromiseisConcatSpreadableworkspace:*commanderkoreancallbacktouchtacitgetoptassignxdglogES2022preserve-symlinksconsole__proto__Object.definePropertyObject.getPrototypeOfclass-validatoronceprettyargumentsArrayFloat32ArraymkdirsArray.prototype.flatMapmkdirerrortimetakeflagslook-uptypesafeforEachrm -frjapaneserandomispathsetImmediatepostcss-pluginhardlinksES8rmdirstreamprotobufECMAScript 2022error-handlingclassnamespackage.jsonbytewidthObject.isstarterObservablevaluesbrowserslistWeakMappreprocessorschemapropertycomputed-typesfastifyes2017Setconfigurabletranspilesymbolcallboundshimapiruntimemruanimationprefixformatsettersharedarraybuffergettermatchwebcjkextralistenersreduxharmonygradients css3matchAllpositivestylesnodeInt16Arraytypeerrorreusewhichchaiutil.inspectcharactersdependency managerhasless compilerclassnamestylesheetcodesWebSocketsgroupBy[[Prototype]]internal slotconsumefullwidthmake dirtypanionrfc4122mochaurlsReactiveExtensionssuperagentes6flagoptimisteast-asian-widtheslintconfigArray.prototype.containsecmascriptchromiumprivate datapostcssloggingpluginconnecttostringtaghashtc39removepromisesstatelessrequireopenerflatES2017lintimporttextentriesless.jsdayjsSymbolCSSlessbusyargparsestylingcurlES2015namesECMAScript 2020JSON-Schemajsonpathclasseslazytesterjsoncss lessfastcopyprotoreal-timedefinePropertyTypeBox$.extendbundlerfast-deep-copymakePushslotscheme-validationgetfigletlookyamldotenvramdababelfindES2023enderWebSocketbddshebangnopetraverseeslint-pluginfromlengthtrimRightidlestdlibRegExp#flagsUint8ClampedArrayshamwritabledataViewtelephonepyyamlreadcollection.es6gdprreducerHyBistylenumberreadablejwtfind-upfindupwatchconstES6helperstrimStartformsresolvecompareECMAScript 3graphqljavascriptES3toolscryptunicodemkdirppatchspinnerawesomesauceavarecursivefast-copyArrayBuffer.prototype.sliceInt32Arrayminimaloperating-systemuninstallbannerjsdomfunctionloggerexpressioncss variableString.prototype.trim6to5extendterminalcall-boundreducecharacterwgettrimLefttapefantasy-landdefaultinternaltesttoSorted3dfpoffsetequalityflatMaphooksbootstrap lessdeep-copyguidsharedECMAScript 2016dragcreatetoStringTagjson-schemalesscssRegExp.prototype.flagsrm -rfargsescapeconfiglastxdg-openArray.prototype.flatzodstartstringifierwrapES2021performantgradients csslimitedcoreposeshellUint16ArraydescriptionchineseserializationupECMAScript 2015bootstrap cssjoifiledeletecolumnsparentarraydescriptorsuuidStyleSheetweakmapcss nestingparsercall-bindfullstyled-componentsFunction.prototype.namequerystringES2020user-streams_.extendutilsponyfillObservablesaccessibilitywindowspushstringifyvestwordwrapfetchregular expressionassertselectrongetintrinsicrangeerrorTypeScriptfunctionsIteratorapollovariablesreact animationenvworkerprunees5intrinsic@@toStringTagdescriptorrobuststyleguidequeryarraybufferinterruptsgroupcorsprotocol-buffersstableconcatgenericsbatchinspectpropertieslrucliauthiteratehookformTypedArrayArray.prototype.filterwaapitypescriptemitratelibphonenumbertranspilercompile lessvaluefunctionalBigInt64ArrayES2018copy0MapcircularnegativeAsyncIteratorECMAScript 2018pipeobjectURLSearchParamsencryptionRFC-6455json-schema-validatorzerowritefixed-widthes2015containsglobtestingsearchSymbol.toStringTagcmdformattingdeep-clonejestmapkarmacoloropensvalidatorsomeECMAScript 2021reacttypesfasttermpropString.prototype.matchAllargumentajvECMAScript 5slicefindLastbabel-corenodejsnpmmobilekeysthrottleinvariantextensionclientESnextvalidationasciiirqestreees-shim APIvarpnpm9es-abstracttddnameeventDispatcherCSSStyleDeclarationastdeepclonetypedarrayindicatorfast-clonehandlersfile systemgetOwnPropertyDescriptorbuffersregexECMAScript 7qsreadablestreamthroatloadingbreaknativeprogress256a11ybindregularchannelvariables in cssvalidappStreamssignalscensorsettingsfilterjson-schema-validationdirectoryObject.fromEntriessideexpresswalkarrayseslintwatchFilecompiler
1.0.0

18 days ago