4.6.87 • Published 10 months ago

@erboladaiorg/dolore-velit v4.6.87

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

@erboladaiorg/dolore-velit 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('@erboladaiorg/dolore-velit');
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

$.extendserverieAsyncIteratorinsyntaxschemaArray.prototype.includesfast-clonecryptopostcss-pluginrgbxhrconfigserializationbuffersebselbstarterhotes6consttermBigUint64Arraychinesestyleguidedependenciescoercibleself[[Prototype]]callbacknativeredux-toolkitECMAScript 2023formattingtakevestObject.islogdescriptioncreateless csssortfastifyparseMapes20156to5readablestreampushqueueMicrotaskprotocol-bufferselectronsigintprotobufdayjsTypedArraybindbundlingcollection.es6yupECMAScript 2021awsclassnamesframerforEachforkcurldeep-copyInt16ArrayassertsarttypedarrayseslintsyntaxerrorsortedcircularbabelhasincludespruneECMAScript 2018form-validationiteratorclassesfast-deep-cloneramdarecursivejson-schema-validationcolorsrequiretestingastfast-deep-copyobjectsettingsnegative zerohandlerserror-handlingpackage managerrobustcall-bindinstallerregular expressioncss-in-jsasterisksstatedependency managergetoptdefinefullwidthreactjapaneseidleseszxeventEmittersignalsgitignoremoduleObject.definePropertyyamlbrowserObject.fromEntriesviewwafbcryptURLSearchParamstypeemittraverseWeakSetroutingecmascriptlintgetintrinsic_.extendSetpicomatches2017transpileio-tsweakmapaccessibilityECMAScript 7awesomesauceargs.envfront-endtypeschaiauthES2022effect-tspolyfilljQuerycachePromiseURLdirectoryinspectStreamsES2021busysignalback-endworkertranspilerfluxWeakMapstringifyapislotUint32ArraysetPrototypeOfarrayhasOwnPropertysharedarraybufferconsumetoobjectstylesheetgroupByjshintnpmignoreenvironmentsRegExp.prototype.flagscomputed-typesprototypeWebSocketspathswfescapeerrorpackage.jsonES2016widthcore-jspredictabletypeofwindowTypeBoxtextstringifierdom-testing-librarynpmshimoperating-systemfetchString.prototype.trimSystem.globalruntimenodejsES7gradients csssymbolsflattenargumentpluginregexObservablenegativejsdiffArray.prototype.filterinternal slotserviceacornsymlinksbyteeast-asian-widthutilitydragiambyteOffsetreduxreplayprivate datacss nestinginvarianthttpstrimequalcryptexecuteshebangdeep-clonelocationrandomfunctionalomitpatchregular-expressionmergestyled-componentsArray.prototype.flatMapairbnbbddoptimistagentcolumntestreact-hookstypanionajaxmanagerformcensortrimStartgraphqlTypeScriptpyyamlfile systemworkspace:*internalstoragegatewayletstylesObject.assignshamfastcopywritees2016dataViewSymbol.toStringTagUint8Arrayautoscalingmatchesdirenvironment256eslintconfigFunction.prototype.namefiltervaluedatastructurefantasy-landcompilerECMAScript 5globalarraysbyteLengthspecirqliveterminalisconfigurableglobauthenticationes8helperArray.prototype.flattenES2020Symbolcodeseventsjavascriptobjgradients css3Uint16ArrayESnextwhichfull-widthbundlerHyBiStreamdateArrayBufferlengthextendprogresspinocore__proto__localextrawalklibphonenumbermockingpositivedeepclonecolortddasciipromisesqshandlerglaciertoStringTagsharedBigInt64Arraybootstrap lesspropdiffexitentrieshas-ownArray.prototype.findLastcheckstyledomlistenersfpArray.prototype.findLastIndexlruexecfilerulesequalityArrayBuffer.prototype.slicemkdirpcurriedreact posechromiumYAMLReactiveExtensionsttyxtermtypeerrorprocessindicatorpersistentimportexportflagsrapidutilObject.keysregexpJSON-SchemaES5packagesargvhttpquerystringvariables in cssserializeelmtimesetvarroute53String.prototype.matchAllkeyespreefsfnmatchjson-schema-validatorreact-componentexpressionECMAScript 2017waapinumbermomentcallboundpropertieshardlinksvalidArrayloadbalancingwhatwgassigndescriptoremrECMAScript 3jsonschemaReactiveXarktypetypedarrayfindJSONmacosECMAScript 2022colourdynamodbpreprocessorfastopensslArrayBuffer#slicegetcolumnstrimEndqueueconsoleshellECMAScript 2020arraybufferbabel-coreapollorequestMicrosoftreadablereact-hook-formfastcloneRxUnderscorepurecloudformationcallbindbingenericsless mixinses5ESefficienttouchspawncjkinterruptsfromdeepjsxreadFloat64ArrayES2019privatetsidentifiersenvimmutablehooksglobal this valuefindLastIndexroutestreamcall-boundshrinkwraptypedprefixisConcatSpreadableharmonysafeclass-validatoruser-streamscopy@@toStringTagi18n0slicelockfileanimationscheme-validationbannercomparetypesafesuperstructzerooptimizerinferencesigtermloadingStyleSheethigher-orderuninstallsetImmediatespinnersuperagentspringArray.prototype.flatoutputjsonconcatstatuslanguageesvpcECMAScript 2015signedreducecss variableschemechannelproxyCSSStyleDeclarationInt32ArrayvalidatewritableglobalThispoint-freedeterministicexit-codeutilitiesweaksetparsertoolslastmakeUint8ClampedArrayclassnameCSSworkflowFloat32ArraygetPrototypeOftelephoneECMAScriptcommandclientassertsnsreducertestervalidatorES3eslint-plugintrimLeftloggingvarsstablezodES2023global objectReflect.getPrototypeOfjestquoteminimalsidees2018warning-0ponyfilldatachrometostringtagfpsstreamseslintpluginES6beanstalkcontainscloudfrontdefinePropertyObjectcss lessperformantsequencecallurlphonetyped arraycompile lessuploadformsfulla11ylinkmonorepoexecreact-testing-libraryredactflatMappipeObservablesloggerexpressfiglettoSortedstructuredClonebinaryansivariablesoffsetPushhookformES2015browserlistprettydescriptorstslibcommand-linemixinsboundestreees-shimsmodulesdropjsdomes7lessintrinsictoArraymkdirpreserve-symlinksserializermapqsassertioncommanderECMAScript 2016accessorglobals.gitignoresameValueZeroes-shim APIsymlinkECMAScript 2019posegroupformatmruelasticachegettertacithashInt8Arrayperformanceautoprefixermapreduceresolvejson-schemabufferchildendpointmobilees-abstractsubprocesskeysutilsmetadatawgetsetternamesutil.inspectcliObject.getPrototypeOfprotoregularfunctionsfast-copypopmotionvaluesoptionES8pnpm9Object.valueskoreanlesscssmatchbrowserslistWebSocketbootstrap csskinesisec2windowsnodemockdeleteiteratefunction
4.6.87

10 months ago

4.6.86

10 months ago

4.6.85

10 months ago

4.6.84

11 months ago

4.6.83

11 months ago

4.6.82

11 months ago

4.6.81

11 months ago

4.6.80

11 months ago

4.6.79

11 months ago

4.6.78

11 months ago

4.6.77

11 months ago

4.6.76

11 months ago

4.6.75

11 months ago

4.6.74

11 months ago

4.6.73

11 months ago

4.5.73

11 months ago

4.5.72

11 months ago

4.4.72

11 months ago

4.3.72

11 months ago

4.3.71

11 months ago

4.3.70

11 months ago

4.3.69

11 months ago

4.3.68

11 months ago

4.3.67

11 months ago

4.3.66

11 months ago

4.3.65

11 months ago

4.3.64

11 months ago

4.3.63

11 months ago

4.3.62

11 months ago

4.3.61

11 months ago

4.3.60

11 months ago

4.3.59

11 months ago

4.3.58

11 months ago

4.3.57

12 months ago

4.3.56

12 months ago

4.3.55

12 months ago

4.3.54

12 months ago

4.2.54

12 months ago

4.2.53

12 months ago

4.2.52

12 months ago

4.2.51

12 months ago

3.2.51

12 months ago

3.2.50

12 months ago

3.2.49

12 months ago

3.2.48

12 months ago

3.2.47

12 months ago

3.2.46

12 months ago

3.2.45

12 months ago

3.2.44

12 months ago

3.2.43

12 months ago

3.2.42

12 months ago

2.2.42

12 months ago

2.2.41

12 months ago

2.2.40

1 year ago

2.2.39

1 year ago

2.2.38

1 year ago

2.1.38

1 year ago

2.1.37

1 year ago

2.1.36

1 year ago

2.1.35

1 year ago

2.1.34

1 year ago

2.1.33

1 year ago

2.1.32

1 year ago

2.1.31

1 year ago

2.1.30

1 year ago

2.1.29

1 year ago

2.1.28

1 year ago

2.1.27

1 year ago

2.1.26

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

2.1.17

1 year ago

2.1.16

1 year ago

2.1.15

1 year ago

2.1.14

1 year ago

2.1.13

1 year ago

2.1.12

1 year ago

2.0.12

1 year ago

2.0.11

1 year ago

2.0.10

1 year ago

2.0.9

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

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago