12.6.123 • Published 11 months ago

@diotoborg/est-unde-excepturi v12.6.123

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

@diotoborg/est-unde-excepturi Version Badge

github actions coverage License Downloads

npm badge

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

Example

var typedArrayByteOffset = require('@diotoborg/est-unde-excepturi');
var assert = require('assert');

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

const buffer = new ArrayBuffer(32);

assert.equal(8, typedArrayByteOffset(new Int8Array(buffer, 8)));
assert.equal(8, typedArrayByteOffset(new Uint8Array(buffer, 8)));
assert.equal(8, typedArrayByteOffset(new Uint8ClampedArray(buffer, 8)));
assert.equal(4, typedArrayByteOffset(new Int16Array(buffer, 4)));
assert.equal(4, typedArrayByteOffset(new Uint16Array(buffer, 4)));
assert.equal(8, typedArrayByteOffset(new Int32Array(buffer, 8)));
assert.equal(8, typedArrayByteOffset(new Uint32Array(buffer, 8)));
assert.equal(16, typedArrayByteOffset(new Float32Array(buffer, 16)));
assert.equal(16, typedArrayByteOffset(new Float64Array(buffer, 16)));
assert.equal(16, typedArrayByteOffset(new BigInt64Array(buffer, 16)));
assert.equal(16, typedArrayByteOffset(new BigUint64Array(buffer, 16)));

Tests

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

Object.entriesexecfile@@toStringTagarraysinternalkeycomparecmdieurlsArrayBuffer#slicebeanstalkgetnegative zerosorttoStringTagfast-deep-copykoreanbreakrecursivecloudformationsetmomentapicontainsUint16ArraylocationtoobjectcjkbluebirdargumentexecutetranspilerpackageslinewrapmoduleregexpString.prototype.matchAllfunctionses2018rapidES2016hardlinksstringifierlintArrayBuffer.prototype.sliceexpresstraverseprivate datamulti-packagehashstdlibworkflowdebugfromautoprefixerconcatdropemrtoArraywhichassignlaunchfindweakmapopenspeedECMAScript 2022mimeroutingargsapollodatadependenciescurlUint32ArrayoptimistdatastructureES2021react animationsymbolreact-hooksString.prototype.trimtoSortednumber__proto__RxJSregexopenscorexmlgesturesdebuggercallbindInt32ArraymapObject.ishookstestercompilerisConcatSpreadablemapreduceelbSetexpressionReactiveXbatchmonorepomochabyteLengthes-abstractregularstreamsECMAScript 6make dirnativecloudwatchtsspecsharedarraybufferwrapchaisetPrototypeOfpropertyfixed-widthchinesefastcloneurlwritablestyled-componentsdragprefixcolorprocessECMAScript 5boundanimationes-shimsl10nisObject.getPrototypeOfthrottleUint8Arrayreact-testing-librarycolorsdeepESAsyncIteratorrm -frmatchkinesisjoitakedeletedeepcloneformsproxysymlinkinvariantbrowserslistidentifierscryptocheckES2018styleoptionInt8Arrayagentregular expressionsassertiontimecharactersquerypolyfillformatlanguagetypeerrorfeedMicrosofti18nmatchAllmodulesreducenamespromisesgetOwnPropertyDescriptorwalkpatchtransformhigher-orderArrayBuffercssrgbrdsglobalECMAScript 2019flatcloneajvserializerpromisedescriptoriterateredactESnextnamePromiseasyncroute53somegetterdependency managermimetypes.envtddenvironmentstypescriptflatMapinspectmetadataHyBireadablespringes8mime-dbwordwrapawsgetoptArray.prototype.flattenperformancebinexecutablefast-copyopenerconcurrencyqueueemojiajaxsource mapvaluesjsondefaultrandomminimalpnpm9graphql-clienthttpsschemastyleguideefficientextracollectionjQueryinternal slotsymbolsloadingsuperstructloadbalancingtrimRightStreamtrimEndArraykarmaaccessorObject.fromEntriestypedslotmkdirpyamlFunction.prototype.nameArray.prototype.containsES2019sespushBigInt64ArraysetImmediatequoteio-tstypeofemitstableES2017everyECMAScript 7bufferonceendpointargventrieswafcolumnclientfolderstylesprettyjscircularframerdeepcopyfilecloudfrontsidetc39electronprotocol-buffersxhrpropertiesrmrateincludesmakeprototyperegular expressionpropprotobuf_.extendYAMLsortedjsdiffexecamazonttyintrinsicwebsitedescriptorsvarss3serializationFloat32ArraycommandespreeparsedotenvtoolsPushpostcssstartbusyES2020byteOffsetparentsterminalwaapiasciiparsingviewURLSearchParamsxtermremoveforEachinstallerapphasdefinePropertyeventEmitterzodelasticachesimpledbdiffWeakMapvalidationlastslicesqsrssfpsArray.prototype.findLastoptimizercode pointsCSSStyleDeclarationmanipulationTypeScriptsuperagentindicatorgenericsdirectoryes2017linkcloudtrailpreprocessorargumentsfull-widthpluginpipeimportwgetcolourreworkpyyamlreadablestreamunicodeWeakSettelephonelookES2022symlinksfunctionsafeschemeowninECMAScript 2020assertextendponyfillreact-hook-formgroupByObservableshasOwneventsglobalspicomatchES2023shammkdirequalityweaksetbrowserspinnersjestECMAScript 2021posecollection.es6omitformchildvpchas-ownutilityfastoffsetinferencecreatevalueextensionES3local0dynamodbdaterm -rfequalreal-timefile systemsyntaxidpathbundlerformattingerrorCSScodesES5atomfast-clonestarterArray.prototype.flatMapTypeBoxiterator$.extendshebangecmascriptdataViewdescriptionvalidarktypeuuideslint-pluginIteratorECMAScript 2017hookformestrimsnslruArray.prototype.findLastIndexBigUint64ArraystringconcatMapawesomesaucebddparserbindguidmobileRxthreeinstallrangeerror3dcommand-linechromevalidatecore-jsenumerableyuppreserve-symlinksendergraphqltextestreefunctionalECMAScript 2016testinggdprzxpositiveRegExp#flagsgroupredux-toolkitec2rfc4122fastifyrobustserializecomputed-typesdom-testing-librarydayjsphonejavascriptObject.assignstreams2htmlcliworkspace:*configpostcss-plugintyped arraydataviewreduxworkerruntimetypesafees2015columnshelperobjectfind-upflattenfilterRegExp.prototype.flagsnodecommandercallbacklook-uptapesetterlistenersenveventDispatcherpersistentxdg-openescapepackagefindLastIndexStyleSheetfullgetintrinsiclogArray.prototype.filtertslibxdgnodejsconsumeclass-validatorshrinkwrapjshinttaskArray.prototype.includes[[Prototype]]ES8ECMAScript 2023censorshellES7Reflect.getPrototypeOfstreamtestWebSockethasOwnPropertyquerystringbinariesbrowserlistMapObject.definePropertya11yimmutablebundlingUnderscoretouchnopecall-boundes-shim APImkdirsreact poseidletrimStartbuffersSymbolscheme-validationqueueMicrotaskeslintpluginObservableastfigletmruwaittostringtagRFC-6455Objectreactes5artcallboundvariablessequencees6resolveoutputbytecopyObject.values256settingsiamInt16ArraydirprogresstrimLefttypedarraysmatchesvesteditorECMAScript 2015tapshimvisualrequireform-validationTypedArraylockfilechromiumlimitedeast-asian-widthdefinehttpURLfindLasttermconsoleES6getPrototypeOfzeroenvironmentdeterministiclibphonenumbercloudsearchratelimitglacierawaitpopmotionutil.inspectfast-deep-clonedeep-clonetypanionreducerlengthansistoragegatewayprotosharedeslintutilObject.keysinputebsfinduptypesconfigurablenegativeglobjapanesemoveUint8ClampedArrayes7stylingassertsloggerredirectwalkingobjECMAScript 2018call-bindcharacterswfsameValueZerochannelfetchspinnerarrayspawnaccessibilityFloat64ArrayimportexportES2015exehelpersWebSocketsflagsjsdomJSON-SchemakeysfullwidthlazyreadstatelessthroatECMAScript 3loggingsearchJSONavasubprocess
12.6.123

11 months ago

12.6.122

11 months ago

12.6.121

11 months ago

12.6.120

11 months ago

10.6.93

12 months ago

6.1.42

1 year ago

6.1.45

1 year ago

6.1.44

1 year ago

6.1.43

1 year ago

2.1.16

1 year ago

12.6.118

11 months ago

2.1.14

1 year ago

12.6.117

11 months ago

2.1.15

1 year ago

9.6.78

1 year ago

2.1.12

1 year ago

12.6.119

11 months ago

9.6.79

1 year ago

2.1.13

1 year ago

2.1.10

1 year ago

2.1.11

1 year ago

4.1.29

1 year ago

11.6.115

11 months ago

11.6.114

11 months ago

11.6.99

12 months ago

9.4.69

1 year ago

11.6.113

11 months ago

11.6.98

12 months ago

9.4.68

1 year ago

11.6.112

11 months ago

11.6.97

12 months ago

9.4.67

1 year ago

11.6.111

11 months ago

11.6.96

12 months ago

6.2.46

1 year ago

11.6.110

11 months ago

11.6.95

12 months ago

11.6.94

12 months ago

11.6.93

12 months ago

6.2.45

1 year ago

9.6.85

12 months ago

9.6.86

12 months ago

7.4.48

1 year ago

9.6.83

12 months ago

7.4.49

1 year ago

9.6.84

12 months ago

9.6.89

12 months ago

9.4.66

1 year ago

11.6.117

11 months ago

9.6.87

12 months ago

11.6.116

11 months ago

9.6.88

12 months ago

9.6.81

1 year ago

9.6.82

12 months ago

9.6.80

1 year ago

8.4.66

1 year ago

7.4.50

1 year ago

7.4.51

1 year ago

7.4.52

1 year ago

7.4.53

1 year ago

9.4.73

1 year ago

7.4.58

1 year ago

9.4.72

1 year ago

7.4.59

1 year ago

9.4.71

1 year ago

9.4.70

1 year ago

7.4.54

1 year ago

9.4.76

1 year ago

7.4.55

1 year ago

9.4.75

1 year ago

7.4.56

1 year ago

9.4.74

1 year ago

7.4.57

1 year ago

9.6.92

12 months ago

9.6.93

12 months ago

9.6.90

12 months ago

9.6.91

12 months ago

8.4.65

1 year ago

3.1.16

1 year ago

3.1.18

1 year ago

3.1.17

1 year ago

7.4.61

1 year ago

7.4.62

1 year ago

7.4.63

1 year ago

7.4.64

1 year ago

7.4.60

1 year ago

7.4.65

1 year ago

5.1.42

1 year ago

5.1.41

1 year ago

5.1.40

1 year ago

3.1.23

1 year ago

3.1.22

1 year ago

3.1.25

1 year ago

3.1.24

1 year ago

3.1.27

1 year ago

3.1.26

1 year ago

3.1.29

1 year ago

3.1.28

1 year ago

11.6.104

11 months ago

11.6.103

11 months ago

11.6.102

11 months ago

11.6.101

11 months ago

11.6.100

11 months ago

3.1.21

1 year ago

3.1.20

1 year ago

11.6.109

11 months ago

5.1.39

1 year ago

11.6.108

11 months ago

5.1.38

1 year ago

11.6.107

11 months ago

5.1.37

1 year ago

11.6.106

11 months ago

5.1.36

1 year ago

11.6.105

11 months ago

5.1.35

1 year ago

5.1.34

1 year ago

5.1.33

1 year ago

3.1.19

1 year ago

5.1.32

1 year ago

5.1.31

1 year ago

5.1.30

1 year ago

5.1.29

1 year ago

9.5.77

1 year ago

9.5.78

1 year ago

9.5.76

1 year ago

6.3.46

1 year ago

7.3.47

1 year ago

7.3.46

1 year ago

7.3.48

1 year ago

2.1.9

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago