5.6.73 • Published 11 months ago

@diotoborg/culpa-eum-laudantium v5.6.73

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

@diotoborg/culpa-eum-laudantium 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/culpa-eum-laudantium');
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

commanderIteratorrfc4122speedcloudsearchdefinehandlersdeterministicsharedarraybuffermkdirstypanionspinnersformatjsdomhelpersString.prototype.trimYAMLglobaldirobjectuser-streamsl10nnameenderdataViewbinariestextec2tslibjshintbannertypescriptString.prototype.matchAllfullwidthtypedbrowsergesturesamazonjsdiffformcolorsmakefastcopybeanstalksetArrayes6loggermonorepocompilerglobal objectwaitsetImmediateextraroutingsymlinknamesbootstrap cssWeakSetforEachfunctionalmrustatelessstyleguides3deep-copypredictablesameValueZerofastifytransportcss nestingECMAScript 2020filewaapiCSSfindLastIndexassertbyteLengtharraybufferUint8ClampedArrayES2016sidefpscircularclassnamesanimationelectronlesscssObject.getPrototypeOfnpmignorebyteoperating-systemthreeecmascriptES2015chromeemrtoReversedjwtequalspecinterruptssignalaccessorless$.extendbootstrap lessflattenebsESnextweakmaplrumobileesObservablesreact-hooksassertiontelephoneshellestreeconcatMapxtermJSONexitArray.prototype.findLastIndexes-shim APIzxgenericsinvariantletphoneassertscompile lesschaiES2019touchcorestarterpreprocessorObjectprogresstermhookformiteratorbrowserslistArray.prototype.flattendeepcopyoptimistmomentqueueMicrotaskfast-copyhas-owntypesnegative zerosymbolsstreamshasOwnPropertyparsepluginCSSStyleDeclarationnegativestatusargumentwhichObject.keyscharacterlazyasciiregexpECMAScript 2016nodereplayconcatgetoptlinkjson-schema-validatorformsreduceerrorArray.prototype.containsprotocol-buffersinstallreact animationshareddataviewutilserializePushprotobuffastexecutestreamsymlinksenvironmentssignedviewredux-toolkithelpercomparesequenceelburlrulescodesReactiveXevery6to5nopepostcssvarsURLSearchParamsapolloprototyperamdaObject.iscss less256fnmatcheventDispatcher.envshrinkwrapoutputflagsclientfindLastarktypetrimes2017superagentfptypesafeless mixinsEShotTypedArrayInt16ArrayinternalECMAScript 5RegExp#flagscore-jsutilsuninstalleslint-pluginprivate datatacitastpackage manager__proto__inferencesyntaxerrorArray.prototype.filtertestinggradients css3io-tstrimRightsymbolacornrequestSetsubprocesscurlUint8Arraystylesrfc9562checkmanageroffsetbindpoint-freewritable.gitignorerangeerrordomjsarraysdeep-cloneapifunctiontesterpyyamlcurriedcertificatesmkdirassignvisualbyteOffset-0mergescheme-validationunicodemodulesrapides7Int32Arrayconsumegrouplivesnslogautoscalingflatstoragegatewayyamlcall-bindschemeexpressECMAScriptkoreanbddinspectawesomesauceFloat32ArraydayjssyntaxrandomexecwarningrdsObject.fromEntriessomeES2020deepclonees8onceimportexportconfigurableutil.inspectargvmacosArray.prototype.flatMapchannelutilityRxJSsetPrototypeOfjsxqueuemake dirUint16Arrayasteriskspreserve-symlinkschildi18noptimizerfast-clonepruneES3ECMAScript 2017es5variables in cssfilterreact posepinotakeECMAScript 6less compilernumberendpointzerodragyuphttpgraphqlfsgetintrinsicES2018Reflect.getPrototypeOfReactiveExtensionstypeerrorless cssbabel-corereversedpnpm9glaciertypedarrayself0columnseslintconfigenumerableinputelasticachewidthSystem.globaltraversequerylockfilesortedSymboles-shimscollection.es6serializerfetchperformantdependency managerlanguageES8fullvalidatedom-testing-libraryownvalidationmulti-packageUint32ArrayenvInt8ArrayvestsigtermpolyfillpropertiesrequireJSON-Schemaelmrecursivechromiumexecfilefantasy-landpicomatchprefixtoobjectlisteners_.extendreactsigintbrowserlistfixed-widthMicrosoftTypeBoxawstypesettertrimStartjsonpopmotionnested cssFunction.prototype.namestringifierinstallerpathwindowscss-in-jspipestructuredClonepackagestimetddswfsettingsMapformattingcachejson-schemaStreamES2021patchArray.prototype.flatreducerworkflowvalidWeakMapartprivateslicecallbindloadingfluxsesremovecryptoclass-validatordeletejapanesetostringtagreal-timeslotgradients cssECMAScript 2019Symbol.toStringTagECMAScript 2015mapdeepisConcatSpreadableworkspace:*react-testing-libraryprocessglobalsisArrayBuffer.prototype.sliceimportbuffercomputed-typesBigUint64ArraytypedarraysdynamodbeventEmitterAsyncIteratorreadsuperstructproxycalleventswgetframerkeysdefinePropertya11yES2022hooksgetterhigher-ordercallboundvarfull-widthfast-deep-copyauthgetfile systemObject.valuesirqintrinsicjsonschematoSortedstylesheetglobal this valuematchescloneregular-expressionES2017redacteast-asian-widthform-validationchinesees-abstractspawnes2015findomiteffect-tsnpmcolourshebangcss variablereact-hook-formES5ajvflagbinaryvariablesconsolewritetoArraybcryptRegExp.prototype.flagstestlinuxjoistylingcloudfrontidentifierssignalsconstHyBilastefficientmapreduceauthenticationES6route53quoteerror-handlingdescriptorsdiffexit-code@@toStringTagiterateweaksetwalkcommand-lineStyleSheettrimEndcloudwatchtranspileremitcopymatchAllwhatwgjavascriptless.jsdataresolvecjkArrayBufferreadablestreamWebSocketsafedescriptorescapecollectiongitignorehas[[Prototype]]iamcoerciblefunctionspositivetrimLeftECMAScript 2022ECMAScript 7fromRFC-6455hardlinksStreamswafworkerttyhashloggingObject.assignprettyuploadmkdirpdotenvcryptruntimeentriestc39passwordinternal slotObservabletsminimalgetPrototypeOfArrayBuffer#slicequerystringreadablevaluesObject.definePropertyECMAScript 2021extendairbnbasyncimmutablecssreduxlintclasseses2018rgbqsnodejscensorlibphonenumberglobalThisvalue
5.6.73

11 months ago

5.6.72

11 months ago

5.6.71

11 months ago

5.6.70

11 months ago

4.6.70

11 months ago

4.6.69

11 months ago

4.6.68

11 months ago

4.6.67

11 months ago

4.6.66

11 months ago

4.6.65

11 months ago

4.6.64

11 months ago

4.6.63

11 months ago

4.6.62

11 months ago

4.6.61

11 months ago

4.6.60

11 months ago

3.6.60

11 months ago

3.6.59

11 months ago

3.6.58

11 months ago

3.6.57

11 months ago

3.5.57

11 months ago

3.5.56

11 months ago

3.5.55

11 months ago

3.5.54

11 months ago

3.5.53

11 months ago

3.5.52

11 months ago

3.5.51

11 months ago

3.5.50

12 months ago

3.5.49

12 months ago

3.5.48

12 months ago

3.5.47

12 months ago

3.5.46

12 months ago

3.5.45

12 months ago

3.5.44

12 months ago

3.5.43

12 months ago

3.5.42

12 months ago

3.5.41

12 months ago

3.5.40

12 months ago

3.5.39

12 months ago

3.5.38

12 months ago

3.5.37

12 months ago

3.5.36

12 months ago

3.5.35

12 months ago

3.5.34

12 months ago

3.4.34

12 months ago

3.3.34

12 months ago

3.3.33

12 months ago

3.3.32

1 year ago

3.3.31

1 year ago

3.3.30

1 year ago

3.3.29

1 year ago

3.3.28

1 year ago

3.3.27

1 year ago

3.3.26

1 year ago

2.3.26

1 year ago

2.3.25

1 year ago

2.3.24

1 year ago

2.3.23

1 year ago

2.3.22

1 year ago

2.3.21

1 year ago

2.3.20

1 year ago

2.3.19

1 year ago

2.3.18

1 year ago

2.3.17

1 year ago

2.3.16

1 year ago

2.3.15

1 year ago

2.3.14

1 year ago

2.3.13

1 year ago

2.2.13

1 year ago

2.2.12

1 year ago

2.2.11

1 year ago

2.1.11

1 year ago

2.1.10

1 year ago

2.1.9

1 year ago

2.1.8

1 year ago

2.0.8

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago