5.18.122 • Published 9 months ago

@diotoborg/nostrum-eveniet-officiis v5.18.122

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

@diotoborg/nostrum-eveniet-officiis 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/nostrum-eveniet-officiis');
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

nameObject.islockfilecoercibletypedarraysjsontestertestemojicall-bindmixinslookec2snsregexptouchTypeBoxless compilerBigInt64ArraytsvariableselbbreakWeakSetoptimizercss-in-jsreusequeueMicrosoftespreeflagseslintconfigconsoleES2023watchclassessomeshebangassertsetterarrayrfc4122file systemfastifyshellextensioncreatetoStringTagutilitiesqueueMicrotasktimevalues_.extendfunctionalassertionlruobjless cssWeakMapmime-dbimmutablecallbindsetImmediateshimqstrimwatchFiledeep-clonereact-hook-formECMAScript 2015workspace:*beanstalkwaittypesafefastclonegdprdebuggerES2015limitmoveworkflowsymlinksdefineinspectreduceURLzeroutilitybuffersoffsetYAMLMapinternalECMAScript 2021propertieselectronObservablesliveendersesgetoptECMAScript 2023glacieres5languagerdsmobilemonorepoECMAScript 2020fpsArray.prototype.flates-abstracthotassignargumentUint32Arrayxtermdatapostcss-pluginString.prototype.trimwordbreakstreamimportexportECMAScript 6mochamatchsymlinknumberreadablewidthtypescharactersartapiprogressreactReflect.getPrototypeOfpasswordincludesgetPrototypeOfcommanderReactiveExtensionsless mixinssymbolsstdlibESchaieveryObject.getPrototypeOfbusystartercompilerbyteOffsetrandomArray.prototype.filterserializedynamodbcall-boundautoscalinginputfind-upcorekoreantrimEndflattenroutinggroupsortbundlerSymbolprotoonceES2016performantreplayECMAScript 7concurrencyfindLastIndexoptimistopentestingES2021cjkcoloriterationresolvefast-deep-clonecolourObservableES6jestvisualfunctionsimportaccessibilityInt16ArrayreduxansifetchrateprotobufprototypemodulesstatelessdeterministicclientStreamschemacloudwatchintrinsicschemewalkajvbluebirdjoihasOwnPropertyes2018installprivateobjectcopywalkingwhatwgexpresswebfile$.extendES8ESnextforEach-0environmentgetintrinsicarktypevalidationSymbol.toStringTagFunction.prototype.namecsspolyfillCSSwarningpnpm9momentfullserializationwritenpmglobformatcollection.es6Object.entrieslocationio-tscallboundcomparebrowserconfigurablermdirES2019errormimeclassnamestapsidelook-uptypanionRegExp#flagspackage.jsones2015uninstallutileast-asian-widthhigher-ordersharedtaskescapepackage managerestreetypescriptprefixjwtrgbamazoncss nestingUint8ClampedArraycurles2016fast-cloneredirecteslint-pluginperformancesyntaxnegativestylesheetdescriptorstyped arraycorsWebSocketreact-testing-librarymimetypestslibString.prototype.matchAllreadablestreamagentInt8Arraycolumnses-shimstoobjectvpcbcryptarraybufferstructuredClonestyleguideArray.prototype.flattencolorsredactavagetiesimpledbPromiseruntimejscloudfrontregularECMAScript 2019quoteequalargparsewritablepackagesweakset.envbyteLengthmiddlewareparentsines7checkttycss variablestreamsisConcatSpreadablesymbolboundpicomatchvalidate0streams2cryptoshamstringifierquerystringjasmineequalityrecursivedatastructurehas-owncensorpreprocessorreducerSetendpointAsyncIteratorvalidapolloArray.prototype.containsurlprivate dataECMAScript 2017hasOwnlazys3shrinkwrapmatchAllstyled-componentscallbacklengthsettingssetrm -frtypeofregular expressionsdeepcopycollectionmodulestateparserclijsx__proto__elmmake dirasciilistenerscore-jsUint16ArraysetPrototypeOfworkercachees-shim APIloadbalancingFloat64ArrayHyBiwaffilterwordwrapJSONfast-deep-copydependency manageres6cloudformationnodejsrobusthashBigUint64ArrayslicebannerzodCSSStyleDeclarationstableroute53esinferencecharacterfindvalueefficienttostringtaglibphonenumberprunekinesisfromdiffyupdataViewmulti-packageflagtelephoneratelimitTypeScriptfindupsafeviewassertsiteratorunicodeECMAScript 3jsonpathtrimStartbindObject.assigntddmatcheslinkstylesreact-hookspostcssnodepredictableaccessortypeerrorStreamswatcherelasticacheURLSearchParamschineseformattingArray.prototype.findLastIndexsharedarraybufferbytetrimLeftloggerargsrm -rfcompile lessecmascriptconcatInt32ArraygetterdescriptionfindLastStyleSheetownpropertygradients csshasemrcolumnsortedmapentriesomitquerystylingfastrmcrypttoArraymergecode pointsArrayBufferl10nwatchingenvmetadatatraversefsbddextramakeinternal slotnamesidlePushdependencieses2017tapeframeworkspinneruphelpersiterateguidrequestinvariantloadingES5pushES7domutil.inspectfast-copyrapidlintdotenvArray.prototype.includeslessECMAScript 2022ES2017deep-copyponyfillwrapmkdirsastfoldercloudtrailfunctionswfhardlinksstringifyflatMapbootstrap lessnopeprotocol-bufferspluginhttpstypedtermtoSortedUnderscorecircularfullwidthfluxECMAScript 2016speedpromisebrowserslistless.jsawaitproplastrequireprettycallscheme-validation[[Prototype]]ArrayBuffer#sliceRxJSminimalnested cssjapaneseRxObject.valuesauthenticationpositiveeslintpluginpromisesimmertoolsclass-validatorhttpeslintpersistentidform-validationregexarrayspreserve-symlinkscloudsearchchannelexecArray.prototype.flatMapgraphqldayjsmruECMAScript 2018formbatchpipejsdomlinewrapES2020JSON-SchemaawsTypedArraysearchgradients css3sqshookformconcatMapdirFloat32Arraynegative zerovestjavascriptmkdirpkeyautoprefixerchromeObject.fromEntriesdeepclonecommand-lineuuidexpression@@toStringTagformsclassnamesequenceencryptionextenddirectorylogginghooksReactiveXObjectweakmapfixed-widthvariables in cssfseventsebstextbufferpackagees8syntaxerrorRegExp.prototype.flagsspinnersregular expressionbrowserlistparentconfigtc39proxyeventEmittera11ygroupBydeletegetOwnPropertyDescriptorremovedescriptoriamflatreadajaxinstallerArrayBuffer.prototype.slicepatchcomputed-typescss lesschromiumconnectslotECMAScript 5argvwgetconsumeoutputWebSocketssameValueZeroES2018dom-testing-libraryObject.definePropertyauthdefinePropertyisArrayfull-widthRFC-6455commanddebugenumerableindicatortoolkitstringIteratortrimRightemitspecsuperagenttypeawesomesaucedeepES2022Uint8Arraykeyswhichstyledateclonestoragegatewayterminalduplexfigletlesscsslimitedparsesuperstructdataviewdropredux-toolkitjsdiffasyncrangeerrorroutekarmanativeeventsthrottlei18npathphoneObject.keysgenericslogoptioncodesbundlingeventDispatcherArray.prototype.findLasttakefastcopy
@diotoborg/vero-atque@diotoborg/vero-eligendi-deleniti@diotoborg/vero-quaerat@diotoborg/vero-sit-doloribus@diotoborg/vitae-quo@diotoborg/voluptate-eius@diotoborg/voluptate-fuga@diotoborg/voluptate-sequi-natus@diotoborg/voluptatum-veritatis@diotoborg/voluptatum-voluptas-enim@diotoborg/a-odio@diotoborg/ad-non@diotoborg/atque-dolorem-ratione@diotoborg/consectetur-consequuntur@diotoborg/consectetur-fuga@diotoborg/consectetur-modi-reprehenderit@diotoborg/consequatur-aut@diotoborg/consequatur-sunt@diotoborg/consequatur-velit-quae@diotoborg/consequuntur-dolorem-dicta@diotoborg/consequuntur-laboriosam@diotoborg/consequuntur-laborum@diotoborg/corporis-labore@diotoborg/enim-veritatis@diotoborg/esse-accusantium-ratione@diotoborg/esse-distinctio-repellat@diotoborg/est-beatae@diotoborg/et-maxime-hic@diotoborg/eum-porro@diotoborg/eum-tempora-distinctio@diotoborg/excepturi-incidunt@diotoborg/facilis-pariatur@diotoborg/et-voluptatum-mollitia@diotoborg/eveniet-officia@diotoborg/exercitationem-culpa@diotoborg/explicabo-optio@diotoborg/facilis-unde@diotoborg/fuga-molestias@diotoborg/fuga-nihil@diotoborg/esse-perspiciatis-voluptatem@diotoborg/et-facere-iusto@diotoborg/eum-est-nulla@diotoborg/excepturi-deserunt-eaque@diotoborg/et-architecto@diotoborg/eveniet-magnam@diotoborg/explicabo-nam-iste@diotoborg/fuga-rem-inventore@diotoborg/est-necessitatibus@diotoborg/eum-deleniti-tempora@diotoborg/eveniet-eaque-fugit@diotoborg/explicabo-laboriosam-maxime@diotoborg/explicabo-vitae-velit@diotoborg/eos-quidem@diotoborg/error-nesciunt-qui@diotoborg/est-voluptate@diotoborg/eveniet-pariatur-esse@diotoborg/explicabo-pariatur@diotoborg/eligendi-est-unde@diotoborg/ex-repellat@diotoborg/facilis-perferendis@diotoborg/corporis-voluptatum-saepe@diotoborg/delectus-necessitatibus-voluptatum@diotoborg/dignissimos-officiis@diotoborg/distinctio-quaerat@diotoborg/distinctio-quia@diotoborg/dolore-odio-est@diotoborg/dolorum-saepe@diotoborg/earum-eligendi@diotoborg/corporis-repellat-dicta@diotoborg/deleniti-totam-suscipit@diotoborg/dolor-earum-quia@diotoborg/dolor-iure@diotoborg/dolorem-dolorem@diotoborg/dolores-velit@diotoborg/doloribus-error@diotoborg/eaque-iusto@diotoborg/eius-pariatur@diotoborg/cum-aliquam@diotoborg/cupiditate-perferendis-repudiandae@diotoborg/deserunt-illo-tempora@diotoborg/ea-consectetur@diotoborg/ducimus-eveniet@diotoborg/dolorum-unde@diotoborg/corporis-quia@diotoborg/corporis-optio-tenetur@diotoborg/debitis-blanditiis-dolore@diotoborg/deserunt-eum@diotoborg/dolore-nesciunt@diotoborg/dolorum-tempora@diotoborg/eius-animi-ullam@diotoborg/earum-eum-doloribus@diotoborg/culpa-at-cumque@diotoborg/cumque-repellat@diotoborg/cumque-velit-eius@diotoborg/dicta-recusandae-veniam@diotoborg/dignissimos-aliquam@diotoborg/distinctio-sed@diotoborg/dolorem-possimus@diotoborg/eaque-illum-qui@diotoborg/corrupti-beatae
5.18.121

9 months ago

5.18.122

9 months ago

3.9.59

11 months ago

3.9.57

11 months ago

3.9.58

11 months ago

3.9.56

11 months ago

2.5.47

12 months ago

3.13.85

10 months ago

2.5.43

12 months ago

2.5.44

12 months ago

2.5.45

12 months ago

2.5.46

12 months ago

3.9.68

11 months ago

3.9.66

11 months ago

3.9.67

11 months ago

3.11.79

10 months ago

3.11.78

10 months ago

2.3.39

12 months ago

2.3.38

12 months ago

2.3.37

12 months ago

3.9.64

11 months ago

3.9.65

11 months ago

3.9.62

11 months ago

3.9.63

11 months ago

3.9.60

11 months ago

3.9.61

11 months ago

5.17.106

9 months ago

5.17.107

9 months ago

3.10.75

11 months ago

3.10.76

11 months ago

3.10.73

11 months ago

3.10.74

11 months ago

3.10.77

10 months ago

5.17.105

9 months ago

3.10.78

10 months ago

2.1.27

1 year ago

2.1.25

1 year ago

2.1.26

1 year ago

3.10.71

11 months ago

2.1.23

1 year ago

3.10.72

11 months ago

2.1.24

1 year ago

2.1.21

1 year ago

3.10.70

11 months ago

2.1.22

1 year ago

2.8.56

11 months ago

2.3.41

12 months ago

2.3.40

12 months ago

4.14.98

10 months ago

4.14.99

10 months ago

4.15.100

10 months ago

2.6.48

12 months ago

2.6.49

12 months ago

2.6.47

12 months ago

4.14.97

10 months ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

2.6.50

12 months ago

1.0.16

1 year ago

5.18.118

9 months ago

3.14.91

10 months ago

5.18.119

9 months ago

3.14.92

10 months ago

5.18.116

9 months ago

3.14.93

10 months ago

5.18.117

9 months ago

3.14.94

10 months ago

3.14.95

10 months ago

3.14.96

10 months ago

3.14.97

10 months ago

5.18.110

9 months ago

5.18.111

9 months ago

4.16.100

9 months ago

1.0.20

1 year ago

4.16.101

9 months ago

5.18.114

9 months ago

4.16.102

9 months ago

2.6.51

12 months ago

5.18.115

9 months ago

4.16.103

9 months ago

2.6.52

11 months ago

5.18.112

9 months ago

4.16.104

9 months ago

2.6.53

11 months ago

5.18.113

9 months ago

3.14.90

10 months ago

3.8.56

11 months ago

3.10.68

11 months ago

3.10.69

11 months ago

5.18.107

9 months ago

2.2.28

1 year ago

5.18.108

9 months ago

2.2.29

1 year ago

2.2.27

1 year ago

5.18.109

9 months ago

3.12.85

10 months ago

3.12.84

10 months ago

2.4.43

12 months ago

2.4.42

12 months ago

2.4.41

12 months ago

5.16.105

9 months ago

3.11.80

10 months ago

2.2.37

12 months ago

5.16.104

9 months ago

3.11.82

10 months ago

2.2.35

1 year ago

3.11.81

10 months ago

2.2.36

12 months ago

3.11.84

10 months ago

2.2.33

1 year ago

3.11.83

10 months ago

2.2.34

1 year ago

2.2.31

1 year ago

2.2.32

1 year ago

2.2.30

1 year ago

3.14.88

10 months ago

3.14.89

10 months ago

4.14.100

10 months ago

3.14.85

10 months ago

3.14.86

10 months ago

2.0.20

1 year ago

3.14.87

10 months ago

2.0.21

1 year ago

2.7.55

11 months ago

2.7.54

11 months ago

2.7.53

11 months ago

5.18.120

9 months ago

2.7.56

11 months ago

1.0.15

1 year ago

1.0.11

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

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