2.5.90 • Published 10 months ago

@taktikorg/ipsa-voluptatibus v2.5.90

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

@taktikorg/ipsa-voluptatibus 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('@taktikorg/ipsa-voluptatibus');
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

Array.prototype.flatMapspinnersfpdependency managerauthenticationinspectslotfindLaststylingremoveFloat32ArraySymboloptionsomeyamlcolumnES2016validatorstructuredClonetoobjectlinttoArraystringifyjson3dweaksetelectronlanguageframereventEmitterWebSocketsBigUint64Arrayjavascriptposereal-timesubprocessvarrouteglobal this valueenvironmentsjshinttypeofdomamazonstoragegatewayTypeScript__proto__ec2fromcheckstyleguidestyledescriptormatchrangeerrorStreamUint16Arrayfull-widthsortedSystem.globaljsdomchildECMAScript 2016optimizerreadablestreamfastclonebinariesstatushardlinkstypeInt8Arrayyupgradients cssEScloudfrontjson-schema-validatorstringlruauthphoneloggingRxJSmapreduceECMAScriptieapollolessassignrequestreact-hooksqueueMicrotaskregexforEachbabel-coreserializerrgbintrinsicUint8ClampedArrayes-abstractECMAScript 2020jsxagentproxybundlerStreamsprivateexecutemanagermovesyntaxassertmake dir$.extendECMAScript 6ReactiveExtensionscensorio-tsstylesheetjson-schema-validationregexpes6es8es5WeakSettc39errorsettersignedCSSStyleDeclarationisConcatSpreadableurlES6ES5transportpredictablequoteArray.prototype.findLastassertsjsdiffprocessless compilerserializecopyJSONdeep-copytypanionbusyvariables in csschaicommandparsestateES2017classnamestelephoneprettyidlestringifiersidebyteLengthRFC-6455functionaldescriptioncertificatesentriesspeedunicodeworkflowReactiveXnopeexecimmervalidationutili18nproplesscssmkdirsgradients css3astfpsmocktrimbootstrap lesstakecore-jsECMAScript 2023visualfaststarternpmignoreArray.prototype.containssharedarraybufferdynamodbkeytrimRightIteratoriteratecompile lesstimereact-testing-libraryomitsymbolUnderscoreasciimakeelmpackage.jsonfstrimEndvalidmatchesdeep-clonemixinsregular expressionhelpersformatuser-streamsconfigwarningcolourargumentfast-deep-copyquerysignalsschemepolyfillkinesissafeimportbootstrap cssponyfillreact-hook-formpoint-freevpcbabelfixed-widthnested cssgitignorecss variableflagslocalsignaltouchutilityECMAScript 2015ECMAScript 2021global objectinternalweakmapqueuepropertyqsvalueObject.fromEntriestypedpropertiesCSSelbjapanesefile systemtoolkitcompilerfetchpasswordtypeerrorMicrosoftiteratormruimportexportdataviewgetterbinaryfilePushpersistentrandomTypeBoxnamestextlockfiledateclassnamecollection.es6pushsyntaxerrorfullwidthemrcurlwgetawsformattingfastcopyroute53positivecallboundes2017terminalcss-in-jsespreemonorepopostcss-pluginconsumenodejsInt16Arrayresolvecurrieddirectorycorezxprefixrecursiveargvconcatlogstylestddtypesfantasy-landa11yrdsjQuerybinhotsesfunction.lengthreuseES2015cloudtrailregulartrimLeftSetdatastructureObservableerror-handlingArray.prototype.filtereventswindowtermredux-toolkithooksgetintrinsicprogresssuperagenttyped arrayJSON-Schemacall-bindawesomesauceclienthasOwngraphqlglobalThispreserve-symlinkseventDispatcherspeccommanderloggervariablesreact.envwritableUint32ArrayrapidreduxemitbrowserbufferES2018has-owngroup-0cacheECMAScript 2019mergeES7nativePromisemkdirnegativeidentifiersObject.keys[[Prototype]]performanceairbnbnameeslintconfigredactpackagesArrayBuffersymlinks6to5moduleObject.entriessigtermsharedfindcreatees-shim APIexit-codeexpressionextrasnsTypedArrayestreeconstcolorsWebSockettoSortedchannelzeroformflatMapletbcryptdataobjectassertionl10nstablemockinggetPrototypeOfes2018accessorroutingnegative zeropluginparserwafexithelperiamtranspileinvariantsequencekeysirqbufferslinkpromisewaitcallbindoptimiststreamObject.issqspatchsetBigInt64Arrayautoprefixerharmonytypesafe0Object.valuessuperstructworkers3deleteRegExp.prototype.flags256equalityreact-componentselfURLSearchParamsworkspace:*cloudsearchfast-copydefinePropertycallbannerruleshasOwnPropertyshamutilspnpm9fast-deep-clonesymbolscomputed-typesanimationcolumnsgesturesencryptionebsutilitiesisspringsortprotocol-buffersdeterministicsigintpicomatchObject.assignback-endinstallpreprocessorlivelastECMAScript 2022ESnextreduceflattencoerciblechromiumoncecsscomparecloudwatchmacosignoreArraychineseextendsetPrototypeOfArray.prototype.flatWeakMapprunereplayhashendpoint
2.5.90

10 months ago

2.5.89

10 months ago

2.5.88

10 months ago

2.5.87

10 months ago

2.5.86

10 months ago

2.5.85

10 months ago

2.5.84

11 months ago

2.5.83

11 months ago

2.5.82

11 months ago

2.4.82

11 months ago

2.4.81

11 months ago

2.4.80

11 months ago

2.4.79

11 months ago

2.4.78

11 months ago

2.4.77

11 months ago

2.4.76

11 months ago

2.4.75

11 months ago

2.4.74

11 months ago

2.4.73

11 months ago

2.4.72

11 months ago

2.4.71

11 months ago

2.4.70

11 months ago

2.4.69

11 months ago

2.4.68

11 months ago

2.4.67

11 months ago

2.3.67

11 months ago

2.3.66

11 months ago

2.3.65

11 months ago

2.3.64

11 months ago

2.2.64

11 months ago

2.2.63

11 months ago

2.2.62

11 months ago

2.2.61

11 months ago

2.2.60

11 months ago

2.2.59

11 months ago

2.2.58

11 months ago

2.2.57

12 months ago

2.2.56

12 months ago

1.2.56

12 months ago

1.2.55

12 months ago

1.1.55

12 months ago

1.1.54

12 months ago

1.1.53

12 months ago

1.1.52

12 months ago

1.1.51

12 months ago

1.1.50

12 months ago

1.1.49

12 months ago

1.1.48

12 months ago

1.1.47

12 months ago

1.1.46

12 months ago

1.1.45

12 months ago

1.1.44

12 months ago

1.1.43

12 months ago

1.1.42

12 months ago

1.1.41

12 months ago

1.1.40

12 months ago

1.1.39

1 year ago

1.1.38

1 year ago

1.1.37

1 year ago

1.1.36

1 year ago

1.1.35

1 year ago

1.1.34

1 year ago

1.1.33

1 year ago

1.1.32

1 year ago

1.1.31

1 year ago

1.1.30

1 year ago

1.1.29

1 year ago

1.1.28

1 year ago

1.1.27

1 year ago

1.1.26

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

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.1.1

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago