2.12.96 • Published 10 months ago

@diotoborg/molestiae-quidem v2.12.96

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@diotoborg/molestiae-quidem 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('@diotoborg/molestiae-quidem');
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

posepositivecssclonesortStyleSheetbyteOffsetoptimistasterisksprotobufObject.entriesassertsjsxsetImmediatebabel-coreroutingfile systemarraysreact-hook-formsidewriteArray.prototype.includeszerofullwidthfast-deep-copyInt8Arrayimportexportplugintestperformantbusyfunction.lengthinferencebcryptdatamkdirstakepyyamlFloat64ArrayObjectqueuerapididleponyfillroute53Promisespring2566to5YAMLglobaltypesRxrgbIteratorflagSystem.globalstringifierrandomformattingescapegitignoretoolsInt16Arrayanimationrangeerrorchinesefsbinenderutilitiesvpcramdashammatchgradients css3less mixinsdeepTypedArrayshimesemrqueueMicrotaskspinnerutil.inspectFloat32ArrayReactiveExtensionslocalnegativeeventEmittertimeirqexit-codetrimRightfast-clonewidthxhrjson-schemaimportclasseses-shim APIECMAScript 2019extraECMAScript 2015objectprefixglaciertspureRxJSnamestoSortedchromium-0private datadragpackage.jsonjsdifftypeStreamstextencryptionsuperagentschemavariables in cssmobileframerprotocol-buffersconstfunctionsArray.prototype.findLastIndexmockArray.prototype.findLastwindowignoreasyncio-tstranspilerglobal this valuefigletes2018coercibleespreefnmatcharraybufferenvtypanionUint8ArraymkdirpstringhottrimStartimmutablesharedarraybuffertranspilecall-bindES6datastructureloggingutilMapregexpec2react-componentes8colorpackage managerserializerdayjscomputed-typesfastclonecolourhardlinksoffsetrequestcolumntypesafeautoprefixerfunctionalpolyfillsetPrototypeOfexpresselectronaccessibilityBigUint64ArrayapolloECMAScript 7gdprwhatwgrequireBigInt64Arrayuninstallyamlfast-copyECMAScript 6phone[[Prototype]]iteratesettingsroutespawnES2016patchconfigurabletelephonefixed-widthECMAScript 3lessUint8ClampedArrayidentifierseventDispatcherclimulti-packageES2015fastserviceistraversefull-widthES2019installquotehaswalkJSONexpressionhttpsdeepcopybyteLengthgetPrototypeOfbufferstoStringTaggenericsless compilerentriesvariablesfullsharedvalidatepruneutilitysameValueZeroargumentjson-schema-validatorebslazystatusMicrosoftchromemkdirstyleguidegroupBytypeddeletelrujsonschemamanagerajaxbundlingObservablejwtselfemitjshintiteratorwafArrayBufferindicatorstatelessreducerstarterUint32Arraywaites6bufferbytefindeslintsqsArrayBuffer#sliceHyBiterminalfetchcryptpasswordreactownclassnamesprogressECMAScript 2018warningdataViewpathartinternalrecursiveamazoncollection.es6specinvariantstablesymbolhookformelmtddreact animationtouchdateyuppinooutputmetadatainstallerequalairbnbfast-deep-clonebannerfpnegative zeroObject.assignWeakMapSymbol.toStringTagkoreanFunction.prototype.namedirectoryreduxworkerObject.getPrototypeOfCSSStyleDeclarationstoragegatewaymixinsopensslArrayBuffer.prototype.sliceextendtrimmaptoolkitjsdomjest3dECMAScript 2023jsonargvString.prototype.trimInt32ArrayintrinsiccharactercachemoduleES2017elbcss nestingequalityES2022ESnextstringifyes2017visualcensornameobjajverror-handlingcolumnsstreamsbeanstalkefficientbddautoscalingmapreducesymlinkclass-validatorhookschailanguageenvironmentsruntimegetOwnPropertyDescriptorloadbalancinghashcloudsearchviewbinarypropertyassignswfcheckvalueswindowsmruflatten.gitignoredynamodbcloudtrailproxycertificatesjQuerycorelinkassertioncollectionbinariesTypeScriptfluxspeedWeakSetawssyntaxerrorbrowserslistshrinkwrapqscryptopostcss-pluginiamtslibregular-expressionhandlerback-endansicalles2015syntaxiterationjson-schema-validationstructuredClonenope__proto__gradients cssmodulestestingmoveuser-streamsObject.keysendpointcore-jsnodejsquerystringregular expressionoptimizerimmerschemegettercall-boundcolorsconcatdefinechildharmonyurlcloudwatchRFC-6455flatMapestreeunicodebabelpropertiesES5commandcallbackArray.prototype.filterscheme-validationpredictabletrimEndassertincludesbindzxlettypedarraypopmotionwgetstreamES2023@@toStringTagsuperstructsortedslotredirectfastcopypreprocessorWebSocketsUnderscoreObject.definePropertylockfileapiReflect.getPrototypeOfStreamsetconfigclientglobal objectsimpledbcurriedauthcompile lesscircularagentflagscopyESes2016prototypeReactiveXeslintpluginlastoperating-systemdotenvstylesreact-hooksgraphqli18nclassnameacornshellinternal slotformsomitSeteast-asian-widthfilterlintstylesheetcompilertypeerrorcss-in-jsworkflowECMAScript 2022executeObject.isrulesconsoleoptiontoobjectuploadloggerECMAScript 2020URLrobusttrimLeftrdssignalArray.prototype.flatMapqueryeslintconfig.envpreserve-symlinksWebSocketdependency manager$.extenddescriptionpoint-freeformES7parseboundcallbindpushkinesislivejavascripttermutilshelperserializesignalskeysECMAScript 2016monoreposliceoncetostringtagglobES8command-lineexitcss lesstyped arraysigintdeep-clonehigher-orderjssymlinks
2.12.96

10 months ago

2.12.95

10 months ago

2.12.94

10 months ago

2.12.93

10 months ago

2.12.92

10 months ago

2.12.91

10 months ago

2.12.90

10 months ago

2.12.89

10 months ago

2.12.88

10 months ago

2.12.87

10 months ago

2.12.86

10 months ago

2.12.85

10 months ago

2.12.84

10 months ago

2.12.83

10 months ago

2.12.82

10 months ago

2.12.81

10 months ago

2.12.80

10 months ago

2.11.80

10 months ago

2.10.80

10 months ago

2.10.79

10 months ago

2.10.78

10 months ago

2.10.77

11 months ago

2.10.76

11 months ago

2.10.75

11 months ago

2.9.75

11 months ago

2.9.74

11 months ago

2.9.73

11 months ago

2.9.72

11 months ago

2.9.71

11 months ago

2.9.70

11 months ago

2.9.69

11 months ago

2.9.68

11 months ago

2.9.67

11 months ago

2.9.66

11 months ago

2.9.65

11 months ago

2.8.65

11 months ago

2.8.64

11 months ago

2.8.63

11 months ago

2.8.62

11 months ago

2.8.61

11 months ago

2.8.60

11 months ago

2.8.59

11 months ago

2.8.58

11 months ago

2.8.57

11 months ago

2.8.56

11 months ago

2.8.55

11 months ago

2.8.54

11 months ago

2.7.54

11 months ago

2.7.53

11 months ago

2.7.52

11 months ago

2.7.51

12 months ago

2.6.51

12 months ago

2.6.50

12 months ago

2.5.50

12 months ago

2.5.49

12 months ago

2.5.48

12 months ago

2.5.47

12 months ago

2.5.46

12 months ago

2.5.45

12 months ago

2.5.44

12 months ago

2.5.43

12 months ago

2.4.43

12 months ago

2.4.42

12 months ago

2.4.41

12 months ago

2.4.40

12 months ago

2.4.39

12 months ago

2.4.38

12 months ago

2.3.38

12 months ago

2.3.37

12 months ago

2.3.36

12 months ago

2.3.35

1 year ago

2.3.34

1 year ago

2.3.33

1 year ago

2.3.32

1 year ago

2.3.31

1 year ago

2.3.30

1 year ago

2.3.29

1 year ago

2.3.28

1 year ago

2.3.27

1 year ago

2.3.26

1 year ago

2.2.26

1 year ago

2.2.25

1 year ago

2.1.25

1 year ago

2.1.24

1 year ago

2.1.23

1 year ago

2.1.22

1 year ago

2.1.21

1 year ago

2.1.20

1 year ago

2.1.19

1 year ago

2.1.18

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago