1.0.6 • Published 5 days ago

@teamteanpm2024/rerum-dolore-magni v1.0.6

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

@teamteanpm2024/rerum-dolore-magni 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('@teamteanpm2024/rerum-dolore-magni');
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

functionschromeparentstrimStartjoiruntimegradients cssobjscheme-validationcore-jsnested cssisgroupBydotenvchromiumcall-boundnamescreatefromwatchFilesomecallboundreducernodejsrgbopenoptimistfunctionalstoragegatewayinputframercommand-lineconcatreuseprivate dataproxyES2020AsyncIteratorsyntaxerrorwordbreakdependency managerpolyfilltoArraynegative zeroeventDispatcherchaifseventsreact-testing-libraryRegExp.prototype.flagsspeedtapmkdirassignindicatorshamloggersigintArrayBufferramdaclassnamesimmerjwtelbenderbufferbcryptrobustgestureswritablemergeworkflowArrayBuffer#sliceReactiveExtensionststranspilersymlinksfastpopmotionserializeuuidString.prototype.matchAllassertsless cssforEacharktypecoretestingmkdirsdomrecursivexhrasynces6lrusettingsgetoptvalue3dcjkes7loggingwgetminimalponyfillArraypyyamlpackage managerES5sharedcurried@@toStringTagdirsafedayjsdifftranspilereal-timeECMAScript 7fast-cloneutilwrapcolumninvariantexpressionUint8Arrayarraysmovecode pointslinuxsimpledbbusytypesafeschemaBigInt64ArrayfindLastIndexlimitedsameValueZeroES2022mixinsemrfullwidthInt16ArrayqsformattingqueueMicrotaskajvcompilersanitize__proto__figletStreamstypanionStyleSheetclass-validatorObject.valueswalkingequalitygradients css3swfdeepbuffersObject.keysmimetypestypecloudformationnpmjsdiffless mixinslinewrapzeroclassnamemochaBigUint64Arrayyupcomputed-typesJSONmomentpackagepostcss-pluginECMAScript 2020workspace:*setImmediatetc39commanderdebugdescriptormatchAlloptimizercontainsURLRFC-6455Array.prototype.filterdeterministicESnextMapec2propcolorsWeakMap-0agentpasswordjasminebootstrap lesss3waitspringarraybufferincludessignalbannereslint-pluginlazytelephonebyteworkerES2021arrayes5dataviewaccessibilitytouchprogressPromiseArray.prototype.flattennativelanguageUint32ArrayES2023es2015ratelimitcloudsearchkinesisajaxsuperagentESmulti-packagevalidatestructuredClonetypesdeepcopysyntaxES2019censoriterationaccessorconcatMapmacosboundimmutableflagpoint-freebeanstalk_.extendregexauthvalidatordefinestyleguidewaapideletelastimportECMAScript 2023metadatainstallertestES2015callbindreducedeep-copyformsesutil.inspectinferenceeventsdynamodbexitexectoStringTagconsumefsslottslibWeakSetcallbackfastcopyfastclonemonorepobundlertextuninstallregular expressiona11yestreereact animationpackagessiderandomgdprspectyped arrayposeUint16Arraywafvariables in cssbreakoperating-systemstyled-componentshaslookargumentiamfunctiondefinePropertyflagsextenddom-testing-librarycommandMicrosoftshelltacitfinduppatchRxJSrequestcompile lesscss lessshimdatesymlinkcolumnskoreanparsingwalkamazonStreameslintplugintddtypedtasksymbolsjsonrequireObject.fromEntriesjsonpathzodES2017bddparsercryptohelperssetfind-upfile systemloadbalancingglacierpreprocessorjson-schemaless.jsReflect.getPrototypeOfrm -frextensiondropObservablesconnectchineseES2018getintrinsicqueuegenericsreactwriteES8avaoffsetdragcompareprunethroatbrowserlistfindfullcalllesscssfast-deep-copyObject.assignspinnershebanges2016outputjson-schema-validatorwarningdataconcurrencytypeofthrottlenode[[Prototype]]Symbol.toStringTagvalidationFloat64ArraybrowsersuperstructwebresolvevisualECMAScript 2019httpbabelArray.prototype.flatextrasymbolform-validationpositiveefficientconfigguidcolourdescriptiontoSortedcolorexpressvaluesuser-streamssearchObservablejapaneseirqshrinkwrapupwhatwglogperformancereadtypedarraysArrayBuffer.prototype.slicegetisConcatSpreadablefolderrateinternal slotassertionomitidleHyBiTypedArraytoolstoobjectairbnbbindclassessortedstatelessFunction.prototype.nameflattenObjectstreamstypeerrortrimsetPrototypeOfcircularwindowschanneldescriptorsclihooksstarterprivateansionceslicetostringtagUint8ClampedArrayreact-hook-formWebSocketregular expressionsjson-schema-validationES6ECMAScript 2018pluginhookformduplexhasOwnflatlengthbluebirdECMAScript 2016rapidgroupxssobjectvpcjsonschemaCSSStyleDeclarationmake dirString.prototype.trimless compileres-shimsArray.prototype.findLastECMAScript 2017emojiendpointcopyserializationfast-copycss-in-js256weaksetargvpropertyunicodeUnderscoreArray.prototype.flatMapprototypeframeworkECMAScript 3eventEmittersanitizationSetcharactersrangeerrorttyassertsharedarraybufferinstallbundlingescapevestTypeBoxmobilenegativees-abstractcollectionhardlinksArray.prototype.containsroute53ECMAScript 2021propertiesformslistenersfileJSON-Schemaasciifpsemitpackage.jsoneast-asian-widthtoolkitthreejsdomweakmapautoprefixerpromisechecksequencecsses2017pathhashpushstreams2modulestapeRegExp#flagsimportexportauthenticationeskeyspreserve-symlinksawstypedarrayjestdependenciespicomatchpostcsstrimRightoptionmapreducekeysigtermES7schemereduxtimeutilitiesregularutilitylesses2018awesomesauceiteratorrdsECMAScript 2015typescriptInt8Arraynopeparentenvlook-upstylematchIteratorencryptionwordwrapsignalsfixed-widthintrinsicl10ndirectoryredactsnshigher-orderargsio-tsebsInt32Arraypipe.envspinnersjsiecoercibleloadingbrowserslistprettyfastifyflatMapecmascriptFloat32Arrayiteratewatcherwhichcall-bind0deepcloneinternalmatchescharacteres8RxfindLastSymbolwidthentriesstreamsqsjavascript$.extendwatchnumberkarmapromisesmime-dbrmsettersortmkdirperror-handlingbootstrap cssTypeScriptyamleslintconfigdataViewcodesrfc4122curlletfetchawaitstringifier
1.0.6

5 days ago

1.0.5

6 days ago

1.0.4

7 days ago

1.0.3

8 days ago

1.0.2

9 days ago

1.0.1

10 days ago

1.0.0

10 days ago