4.10.96 • Published 2 years ago

@swenkerorg/molestiae-et v4.10.96

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

@swenkerorg/molestiae-et 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('@swenkerorg/molestiae-et');
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

Object.isrestfuluser-streamscallbackdotenvObject.assignupoptimizermkdirsgroupbanneres-shimsnamephonefast-deep-clonexmlsnsincludescharactersmkdirpchairdseveryreadglacierflattslibinspectdataforEachcomputed-typesajvglobutilsminimalsimpledbjsdomisConcatSpreadablehasOwnPropertytypanionfront-endbusyrss0writematchloges2017.gitignoretesterfastclonetacitjapaneseECMAScript 2017postcsstoReversedmapreducelookpushhelperfindupproxyparseECMAScript 2016patchgetOwnPropertyDescriptoravaconsolesinatraswfES6ECMAScript 2015loadingESrm -rfsimple cacheicues5comparenativetypeerrorObjectprivatechildmanagerwaitmomentObservablestypekey parcachebddinferencenodeio-tsdayjslook-upieArray.prototype.flathtmlmodulebufferclassesi18nautoprefixerworkflowcryptoUint8ClampedArrayemrmodulesTypeBoxefficientECMAScript 2020cliloggingserializationtrimprivate dataclass-validatorcharsetcolorshas-ownfindLasthookskarmagenericsimportexportexpressionschemepyyamlutilityonceMicrosoftprunepropertiesdefinesqsshebangloggerinstall[[Prototype]]core-jscloudtrailArrayBuffer#slicerfc4122guidcurlutil.inspectinvariantcommand-lineeslibphonenumberes-abstractcallboundflatMapMaphandlerECMAScript 7reduceruninstallformatbrowserlistjasminefast-copypromiselockfileoptimistArrayBufferES2020find-upcode pointsdeep-copyeventsomitdiffrulescircularredirecttypedarrayfixed-widthworkspace:*URLSearchParamsexecwalkingObservableregular expressionStreamWeakSetnodejsconcatMapexpresssetterstyled-componentspositivedebugES2015dataViewcloudsearchebsresolveaccessibilitytoStringTagbundlingformattingUnderscorecall-bind_.extendgettertermcommanderutil@@toStringTagform-validationtrimStarturlspawnStyleSheetajaxiteratornpmignoretransportyupescapefilterpoint-freecheckenvironmentsES2017Int8ArraysorteddragprocessArraydependenciesArray.prototype.flatMapcoveragetrimEndnpmtoArrayobjkey valueYAMLeast-asian-widthpackage managerstylingelasticachequerynamescloudwatchserializequeuebindECMAScript 2022symlinksjshintWeakMaptoolkitlintartatomfastCSSStyleDeclarationinputES2019espreebrowseramazonrouterroute53monorepotraverseconsumetc39Object.definePropertyargvmochaeffect-tspluginkeyenvasserteslint-pluginposeformscopyhigher-orderzxreversedECMAScript 3linkwidthgetPrototypeOfhashvalidObject.fromEntrieseslintkeyswhatwgtouchSetboundidzodpreprocessorcharacternegative zerodescriptorslastgraphqlreduxapollopathtypesvalidaterm -frfolderlanguageHyBisetPrototypeOferrornegativeeventEmitterfastifyjsdiffexecfilecallservicetimedynamodb256ECMAScript 2019redux-toolkitsetImmediatedeepclonemulti-packageJSONsyntaxxtermclassnamesbytehttpsdirbuffersvalidationtypesafethreeperformanceconfigurablenopebinaryconcatsearchgitignoretoSortedinternalRegExp#flagsconverttoobjecttoolsfunctiones2018entriessortgetes-shim APIworkerInt16Arrayformimmutabledropoffsetfast-clone.envtapschemaroutingparserbrowserslistassertionfeedtypeofslotcall-boundPromisereverseutilitiesReactiveXWebSocketsfetchstylesRxvariablesapies2016Array.prototype.includescoerciblesliceagentawesomesaucefileroutejsonregularObject.valuesflattenvaluePushserverjsxsesECMAScript 6ttyistanbultakequerystringsharedWebSocketcssvisualwafRFC-6455popmotionwarningES7AsyncIteratorTypeScriptincss-in-jsrapidfnmatchsetfromsameValueZeroArray.prototype.filterfile cachewgethelperses6outputstablemake dirdeepcopyinstrumentationcolumncreatestylesomearrayscolormatchestextindicatoriamprototypeeventDispatcherclientprogressrmbyteLengthxhrtrimLeftfpschromiumcollection.es6regular-expressionqsbundler
4.10.96

2 years ago

4.10.95

2 years ago

4.10.94

2 years ago

4.10.93

2 years ago

4.10.92

2 years ago

3.10.92

2 years ago

3.10.91

2 years ago

3.10.90

2 years ago

3.10.89

2 years ago

3.10.88

2 years ago

3.9.88

2 years ago

3.9.87

2 years ago

3.9.86

2 years ago

3.9.85

2 years ago

3.9.84

2 years ago

3.9.83

2 years ago

3.8.83

2 years ago

3.8.82

2 years ago

3.8.81

2 years ago

3.8.80

2 years ago

3.8.79

2 years ago

3.8.78

2 years ago

3.8.77

2 years ago

3.7.77

2 years ago

3.7.76

2 years ago

3.7.75

2 years ago

3.7.74

2 years ago

3.7.73

2 years ago

3.7.72

2 years ago

3.7.71

2 years ago

3.6.71

2 years ago

3.6.70

2 years ago

3.5.70

2 years ago

3.5.69

2 years ago

3.5.68

2 years ago

3.5.67

2 years ago

3.5.66

2 years ago

3.5.65

2 years ago

3.5.64

2 years ago

3.5.63

2 years ago

3.5.62

2 years ago

2.5.62

2 years ago

2.5.61

2 years ago

2.5.60

2 years ago

2.5.59

2 years ago

1.5.59

2 years ago

1.5.58

2 years ago

1.4.58

2 years ago

1.4.57

2 years ago

1.4.56

2 years ago

1.4.55

2 years ago

1.4.54

2 years ago

1.4.53

2 years ago

1.4.52

2 years ago

1.4.51

2 years ago

1.4.50

2 years ago

1.4.49

2 years ago

1.4.48

2 years ago

1.4.47

2 years ago

1.4.46

2 years ago

1.4.45

2 years ago

1.4.44

2 years ago

1.3.44

2 years ago

1.3.43

2 years ago

1.3.42

2 years ago

1.3.41

2 years ago

1.3.40

2 years ago

1.2.40

2 years ago

1.2.39

2 years ago

1.2.38

2 years ago

1.2.37

2 years ago

1.2.36

2 years ago

1.2.35

2 years ago

1.2.34

2 years ago

1.2.33

2 years ago

1.2.32

2 years ago

1.2.31

2 years ago

1.2.30

2 years ago

1.2.29

2 years ago

1.2.28

2 years ago

1.2.27

2 years ago

1.2.26

2 years ago

1.2.25

2 years ago

1.1.25

2 years ago

1.1.24

2 years ago

1.1.23

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.20

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

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