5.18.122 • Published 11 months ago

@diotoborg/nostrum-eveniet-officiis v5.18.122

Weekly downloads
-
License
MIT
Repository
github
Last release
11 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

11 months ago

5.18.122

11 months ago

3.9.59

1 year ago

3.9.57

1 year ago

3.9.58

1 year ago

3.9.56

1 year ago

2.5.47

1 year ago

3.13.85

1 year ago

2.5.43

1 year ago

2.5.44

1 year ago

2.5.45

1 year ago

2.5.46

1 year ago

3.9.68

1 year ago

3.9.66

1 year ago

3.9.67

1 year ago

3.11.79

1 year ago

3.11.78

1 year ago

2.3.39

1 year ago

2.3.38

1 year ago

2.3.37

1 year ago

3.9.64

1 year ago

3.9.65

1 year ago

3.9.62

1 year ago

3.9.63

1 year ago

3.9.60

1 year ago

3.9.61

1 year ago

5.17.106

12 months ago

5.17.107

12 months ago

3.10.75

1 year ago

3.10.76

1 year ago

3.10.73

1 year ago

3.10.74

1 year ago

3.10.77

1 year ago

5.17.105

12 months ago

3.10.78

1 year ago

2.1.27

1 year ago

2.1.25

1 year ago

2.1.26

1 year ago

3.10.71

1 year ago

2.1.23

1 year ago

3.10.72

1 year ago

2.1.24

1 year ago

2.1.21

1 year ago

3.10.70

1 year ago

2.1.22

1 year ago

2.8.56

1 year ago

2.3.41

1 year ago

2.3.40

1 year ago

4.14.98

1 year ago

4.14.99

1 year ago

4.15.100

1 year ago

2.6.48

1 year ago

2.6.49

1 year ago

2.6.47

1 year ago

4.14.97

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

2.6.50

1 year ago

1.0.16

1 year ago

5.18.118

11 months ago

3.14.91

1 year ago

5.18.119

11 months ago

3.14.92

1 year ago

5.18.116

12 months ago

3.14.93

1 year ago

5.18.117

11 months ago

3.14.94

1 year ago

3.14.95

1 year ago

3.14.96

1 year ago

3.14.97

1 year ago

5.18.110

12 months ago

5.18.111

12 months ago

4.16.100

12 months ago

1.0.20

1 year ago

4.16.101

12 months ago

5.18.114

12 months ago

4.16.102

12 months ago

2.6.51

1 year ago

5.18.115

12 months ago

4.16.103

12 months ago

2.6.52

1 year ago

5.18.112

12 months ago

4.16.104

12 months ago

2.6.53

1 year ago

5.18.113

12 months ago

3.14.90

1 year ago

3.8.56

1 year ago

3.10.68

1 year ago

3.10.69

1 year ago

5.18.107

12 months ago

2.2.28

1 year ago

5.18.108

12 months ago

2.2.29

1 year ago

2.2.27

1 year ago

5.18.109

12 months ago

3.12.85

1 year ago

3.12.84

1 year ago

2.4.43

1 year ago

2.4.42

1 year ago

2.4.41

1 year ago

5.16.105

12 months ago

3.11.80

1 year ago

2.2.37

1 year ago

5.16.104

12 months ago

3.11.82

1 year ago

2.2.35

1 year ago

3.11.81

1 year ago

2.2.36

1 year ago

3.11.84

1 year ago

2.2.33

1 year ago

3.11.83

1 year 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

1 year ago

3.14.89

1 year ago

4.14.100

1 year ago

3.14.85

1 year ago

3.14.86

1 year ago

2.0.20

1 year ago

3.14.87

1 year ago

2.0.21

1 year ago

2.7.55

1 year ago

2.7.54

1 year ago

2.7.53

1 year ago

5.18.120

11 months ago

2.7.56

1 year 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