4.6.70 • Published 11 months ago

@hishprorg/numquam-beatae-quae v4.6.70

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

@hishprorg/numquam-beatae-quae 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('@hishprorg/numquam-beatae-quae');
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

rangeerrorenvieprotobufArray.prototype.containsreplaynativereact-hook-formvalidationoutputArray.prototype.findLastIndexfunctionalprocessArray.prototype.flatMapeffect-tstypeddataviewESquerystringparsecall-boundkinesisspinnersdynamodbreadablestream3des2016east-asian-widthstatelessshellSystem.globalforkreduxspecfast-clonetypesslotidleloggerdataViewcurljestsuperstructcjkrequireJSON-Schemaarraysfile systemdataArray.prototype.flattenassertionoptimizerIteratorsymlinkrgbArray.prototype.includesmatchAllsignalbootstrap lessparsertrimasciitermequaliterationjsdiffbeanstalkgroupdescriptorsjwtkoreancirculares6Object.entriesamazonlazyweaksetgetOwnPropertyDescriptorfast-copysigtermES7ECMAScript 2019Array.prototype.filtercallregular-expressionmomentio-tsphonehookformcertificatesselfregular expressionlibphonenumbersliceairbnbdiffutilitiesCSSStyleDeclarationschemehashhas-ownwaapiMapfps0typescriptpolyfillpropertybabel-coreECMAScript 2021channelinstallercloudsearchinterruptscore-jsreact-componentacornes2015pluginwidthObject.isartbddtypedarrayscompilerxtermtimeresolveloadbalancinginternal slotdirpropsetImmediatecontainsfullgesturesvestawesomesaucestyleworkerweakmapmodulesnodejsglobalprotoreact-hooksECMAScript 2018corepinosetPrototypeOffull-widthglobal this valueintrinsicESnextomittrimLeftnamesUint8ArrayUint16ArraytoolskeysTypeScriptboundtoobjectfluxsignalswritableregexES2022fantasy-landuploadreact-testing-librarymixinsisirqinternalECMAScript 2023safemovehigher-ordermodulecurriednumberReflect.getPrototypeOfcoercibleignorebyteLengthremovehttpchecktakeelmTypeBoxfigletauthenticationtraversecollection.es6extendincludeseventsstreamredactspringbinaryprefixdatastructurecallbackequalityl10nSymbolchaiECMAScript 2020arrayoptimist256getterobjes-shimsjsdeletepreserve-symlinkssubprocess[[Prototype]]deepcopyjsonstyleguideloadingrulesindicatores-shim APIfast-deep-clonegradients css3ES2018negative zeroa11ystreamsUnderscoreargvglobalThisWebSocketstranspilerterminalpredictableES5browserlistgenericssnshelpersconfigelectronObject.getPrototypeOfcreateemrclassesreadECMAScript 6definePropertyurlnodelogttyworkspace:*walkunicodespawncrypttrimStartglobcharacterimmerframeres2017keyqueueMicrotaskconsolebuffersettertdd.gitignorefunctionswindowtostringtagsignedObservablesclassnamecolourutilityECMAScript 7buffersjoisyntaxquoteassertswindowspyyamlshimArraydescriptionES2017npmignorecodeseslinteslint-plugintyped arrayfindLastIndexvisualhandlerswgetoperating-systemasthooksrandomerror-handlingviewconcatposeECMAScript 2015staterobustmetadatawafguidebsfixed-widthfullwidthpasswordcss-in-jstranspilemruvarsYAMLchinesenpmvareslintpluginvaluereversedStreamsiteratorreduceruninstalldescriptorpositiveproxyasserteventDispatcherbytepathtoolkittrimEnddompoint-freereusestarter-0sharedarraybuffertypeanimationcssmapUint32ArrayflatMapaccessibilityassignjson-schema-validatorzxiamprototypevaliddirectoryinvariantglobal objectloggingscheme-validationprettydefineschemaenvironmentsharmonyhttpsECMAScript 2016mapreduceerrorRxJSreactString.prototype.trimsomecompareexecutejQuerydayjsInt16Arrayhotsham__proto__runtimegraphqlgradients cssfastifylistenersform-validationhasOwnPropertytypedarrayArrayBufferhardlinksasterisksyamlhasdom-testing-librarydeep-copybrowserfnmatchinferencepostcsscallbindlivesameValueZeroarraybuffermulti-packageefficientArrayBuffer#slicetestingstyleslastcommand-lineObject.assignflagsdeepprunetslibfastcopyECMAScript 2022tacitcomputed-typesnegativestringstoragegatewaycommandutil.inspectstructuredClonetextworkflowuuidqueryObject.fromEntriesexitvariables in cssObject.keysPushjsxString.prototype.matchAllmatchestelephoneexecWeakSettoArraymobileconst@@toStringTagcolumnsroutingsymbolfindLastCSSObjectwhatwgexpressionownauthcryptostyled-componentsspeedpackage managerjson-schema-validationES2019Function.prototype.namebannerencryptionES2015toReversedsetnamevaluesECMAScript 3serializelocalfileES2021mkdirscloudformationURLasyncexpresschildBigInt64Arrayextraagentclass-validatorReactiveExtensionsmkdirconfigurabledateArray.prototype.flatcopyes8byteOffsettypeofprivate dataglobalscachedeepcloneregexpclonemacosenumerableendpointvpcdependency managerpushInt8ArraySettypesafeec2reverseletTypedArraypatchinputclientoptionuser-streamsbinariesonceforEachJSONcloudwatchdeep-cloneStyleSheetglaciereveryobjectajvpromisecolorsprotocol-buffersRegExp.prototype.flagspersistentcss nestingrapidinstallmatchinspectarktypegetoptpropertiesimmutablepipefstc39nested csshasOwniterateapilinuxcompile lessdragcolumntypaniontestgetPrototypeOfutilspicomatchoffsetes5PromiseserializerlanguagecloudfrontmanagerES2016es$.extendbrowserslistlessgitignoreenvironmentES2023superagentgroupByprivateroutestylingperformantprogressES6fpmkdirpinlockfileajax_.extendqssqslruhelperless mixinswhichtstesterbcryptvalidatorformattingconsumestringifyECMAScriptdotenvramdawarningSymbol.toStringTagmonoreposwfFloat32ArrayconcatMapsidereal-timestringifierES3fastrfc9562collections3json-schemaformECMAScript 2017es7popmotionWeakMapansispinnerminimalisConcatSpreadableapollothreeargsfunction.lengthstylesheetlinkidentifierslengthpnpm9binstablepackagessigintfetchescapeshebangArrayBuffer.prototype.sliceendertoStringTagcliutilawsflatdroptrimRightponyfilles-abstractjsonschemaemitBigUint64Arrayentriesserializationelbcss lessfindparsingStreamArray.prototype.findLast
4.6.70

11 months ago

4.5.70

11 months ago

4.5.69

11 months ago

4.5.68

11 months ago

4.5.67

11 months ago

4.5.66

11 months ago

4.5.65

11 months ago

4.5.64

11 months ago

4.5.63

11 months ago

3.5.63

11 months ago

3.5.62

11 months ago

3.5.61

11 months ago

3.4.61

11 months ago

3.4.60

11 months ago

3.4.59

11 months ago

3.4.58

11 months ago

3.4.57

11 months ago

3.4.56

12 months ago

2.4.56

12 months ago

2.4.55

12 months ago

2.4.54

12 months ago

2.4.53

12 months ago

2.4.52

12 months ago

2.4.51

12 months ago

2.4.50

12 months ago

2.4.49

12 months ago

2.4.48

12 months ago

2.4.47

12 months ago

2.4.46

12 months ago

2.4.45

12 months ago

2.4.44

12 months ago

2.4.43

12 months ago

2.4.42

12 months ago

2.4.41

12 months ago

2.4.40

12 months ago

2.4.39

12 months ago

2.4.38

12 months ago

2.4.37

1 year ago

2.4.36

1 year ago

2.4.35

1 year ago

2.4.34

1 year ago

1.4.34

1 year ago

1.4.33

1 year ago

1.4.32

1 year ago

1.4.31

1 year ago

1.4.30

1 year ago

1.4.29

1 year ago

1.4.28

1 year ago

1.3.28

1 year ago

1.3.27

1 year ago

1.3.26

1 year ago

1.3.25

1 year ago

1.2.25

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

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