3.15.94 • Published 2 years ago

@erboladaiorg/inventore-minus v3.15.94

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@erboladaiorg/inventore-minus 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('@erboladaiorg/inventore-minus');
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

joibeanstalkregular expressionstsmonorepoimportsliceprettyfixed-widthconcatMapendpointregular-expressionchannelroute53manipulationcoresymlinksjshintconsumeperformantwaapiperformanceconstbrowserlistinHyBihashObservablesrequiregesturesBigInt64Arrayes6fastifyObservablelet256iameventDispatcherbusyObject.getPrototypeOfFloat64Arrayfast-copyboundautoscalingchinesetypescriptcolourutilsECMAScript 5invariantregular expressionjsonschemal10ncalljsonramdareact-hook-formdeep-clonepyyamlfindLastIndexinstrumentationmatchesrobustprotocol-buffersArray.prototype.findLastIndexnodestylerecursivelockfileECMAScript 7mapreducecallbindsideimportexportdiffreversedback-endcallbackmake dirposeUnderscoregetterPushruntimeWeakMapSetcharacterexecbabelsesES2020upwaffolderserializespawnes8ievarutilanimationdescriptorssqsredactfastcopynpmignoretranspileYAMLvpcurlexpression_.extendarraybufferstylingRFC-6455jsdominferencerm -rfmetadatapolyfill0RxJSasyncWebSocketfnmatchoptionESnextgenericsCSSStyleDeclarationshimstyled-componentsfast-clonergbemojiassertionforkReflect.getPrototypeOfformoutputdeeparraysjapaneseflagsremoveFunction.prototype.nameamazonECMAScript 2016storagegatewaypropertieswidthignoreString.prototype.trimArrayBuffer.prototype.slicegraphqlroutingECMAScript 2019definePropertypipeECMAScript 2023columntelephoneframeworkES5structuredCloneobjectextratouchhookscontainsec2readablestreamvariablessubprocessjson-schema-validationES7matchAllutilitiesincludesgitignoreuninstallcommand-lineenderpackage.jsonansitypanionsyntaxacornWebSocketsbinaryttyObject.valuesthreetypesextendcoverageavaloadbalancingtextnegativechecks3String.prototype.matchAllviewcolorwhichmakevalidationfeedprefixsharedarraybufferreadspinnerpostcss-plugintermcloneelectronmatches2018queueMicrotaskECMAScript 2017ECMAScript 2015Streamcall-boundformattingclientpropES2019dataviewfile systemUint32ArraysetterstylesdescriptoriteratorisConcatSpreadableeventEmitterfullRegExp#flagsrangeerrorCSSstreambuffersmkdirconfigES2015binawesomesauceqsform-validationES8zodreact poseassigntoArrayredux-toolkitjsfantasy-landjsdiffes-shim APIfullwidthkoreanarrayqueryObject.isbannerinspectrmBigUint64ArraywhatwgdomappflatMapcurlreact-testing-librarybyteOffsetnegative zerofigletrmdircodesbytetc39searchequalitychildstarterfunctionseslint-pluginTypedArrayes2016dynamodbfunctionES2016installtacitcore-jspnpm9airbnbestreegroupByMapschemetapequoteenumerablesharedenvchaigroupspecservicewarningRegExp.prototype.flagsistanbulvisualentriesES2018csscallboundprogresstapReactiveXObject.fromEntriesgetnametoReversedeveryeslinteslintpluginreal-timelookcloudwatchcolumnsslotkeysbyteLengthdescriptionhardlinkssorteddatestringifierObject.keystimeemitelasticachemoduleswalkingtoobjectatomxhreventsdebuges2015$.extendsortshellbindpuretoStringTagUint16ArrayIteratorES6randomsafetrimEndArray.prototype.filterastweaksetspeeddatareduxserializerhas-owncircularespreecompilercoerciblemruhigher-orderbrowserslistscheme-validationstyleguideprocessbuffernativesuperstructsuperagentasteriskscomparefinduuidmergees-abstractrequest3dnamesfpawspropertyURLdirexecfilefindupStyleSheetstringifylocalesfast-deep-copytdddeep-copyformatparserTypeScriptfromlrudayjsswftypeofserveromitsetImmediateshebangnumberwritablecopytrimRightlook-upartpositivearktypeponyfillfsdom-testing-libraryuser-streamsnodejs@@toStringTagsyntaxerrorjson-schemaglobalsbundlingrsssetPrototypeOfURLSearchParamsqueueweakmaptypeerrorlengthpreprocessormockunicoderegularzxstableESaccessorpoint-freedataViewObjecteffect-tsio-tsglobshrinkwrapvaluelocationReactiveExtensionsreadablehasOwnworkergetOwnPropertyDescriptorerrorregexptypedarrayjQuerywaitsomeimmutableindicatorWeakSetequalprotologgerconcattoSortedES2021languageloggingdragrestfulreverseformspushsameValueZerovaluescensortslibdeterministicInt8ArraystringES3writeSymbolInt16ArrayargvapollochromiumredirectMicrosoftownsymbolsoffsetmomentfull-widthArray.prototype.containshasOwnPropertyclassnamesinternalsettingsrm -frprototypeproxycjkimmertranspileres5css-in-jses2017source maptestArrayBuffer#sliceideslintconfigjson-schema-validatorObject.entriesprunereducefpstrimLeftfunction.lengthES2017picomatchlibphonenumberECMAScript 3symbolStreamsmap
3.15.94

2 years ago

3.15.93

2 years ago

3.15.92

2 years ago

3.15.91

2 years ago

3.15.90

2 years ago

3.15.89

2 years ago

3.15.88

2 years ago

3.15.87

2 years ago

3.15.86

2 years ago

3.15.85

2 years ago

3.15.84

2 years ago

3.15.83

2 years ago

3.15.82

2 years ago

3.15.81

2 years ago

3.15.80

2 years ago

3.15.79

2 years ago

3.15.78

2 years ago

3.15.77

2 years ago

3.14.77

2 years ago

3.14.76

2 years ago

3.14.75

2 years ago

3.13.75

2 years ago

3.13.74

2 years ago

3.13.73

2 years ago

2.13.73

2 years ago

2.12.73

2 years ago

2.12.72

2 years ago

2.12.71

2 years ago

2.12.70

2 years ago

2.12.69

2 years ago

2.12.68

2 years ago

2.11.68

2 years ago

2.11.67

2 years ago

1.11.67

2 years ago

1.10.67

2 years ago

1.10.66

2 years ago

1.9.66

2 years ago

1.9.65

2 years ago

1.8.65

2 years ago

1.8.64

2 years ago

1.8.63

2 years ago

1.8.62

2 years ago

1.8.61

2 years ago

1.8.60

2 years ago

1.8.59

2 years ago

1.8.58

2 years ago

1.8.57

2 years ago

1.8.56

2 years ago

1.7.56

2 years ago

1.6.56

2 years ago

1.6.55

2 years ago

1.6.54

2 years ago

1.6.53

2 years ago

1.6.52

2 years ago

1.6.51

2 years ago

1.6.50

2 years ago

1.6.49

2 years ago

1.6.48

2 years ago

1.6.47

2 years ago

1.6.46

2 years ago

1.6.45

2 years ago

1.6.44

2 years ago

1.6.43

2 years ago

1.6.42

2 years ago

1.6.41

2 years ago

1.6.40

2 years ago

1.5.40

2 years ago

1.5.39

2 years ago

1.5.38

2 years ago

1.5.37

2 years ago

1.5.36

2 years ago

1.5.35

2 years ago

1.5.34

2 years ago

1.4.34

2 years ago

1.4.33

2 years ago

1.4.32

2 years ago

1.4.31

2 years ago

1.4.30

2 years ago

1.4.29

2 years ago

1.4.28

2 years ago

1.4.27

2 years ago

1.4.26

2 years ago

1.4.25

2 years ago

1.4.24

2 years ago

1.3.24

2 years ago

1.3.23

2 years ago

1.3.22

2 years ago

1.3.21

2 years ago

1.3.20

2 years ago

1.3.19

2 years ago

1.3.18

2 years ago

1.3.17

2 years ago

1.3.16

2 years ago

1.2.16

2 years ago

1.2.15

2 years ago

1.2.14

2 years ago

1.2.13

2 years ago

1.2.12

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago