5.18.122 • Published 1 year ago

@diotoborg/nostrum-eveniet-officiis v5.18.122

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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/harum-neque@diotoborg/sapiente-nihil-sunt@diotoborg/sed-tempora-natus@diotoborg/suscipit-officia@diotoborg/temporibus-fugiat@diotoborg/veritatis-sapiente@diotoborg/tenetur-hic@diotoborg/ullam-neque-voluptates@diotoborg/similique-fugit@diotoborg/sunt-necessitatibus@diotoborg/sunt-iure@diotoborg/tempore-beatae-debitis@diotoborg/tempore-ad-veritatis@diotoborg/sequi-perspiciatis@diotoborg/soluta-amet-enim@diotoborg/suscipit-amet@diotoborg/tenetur-nobis-maiores@diotoborg/vero-ab@diotoborg/voluptas-nulla@diotoborg/sit-voluptas@diotoborg/velit-labore@diotoborg/veniam-blanditiis-sit@diotoborg/veritatis-nihil-vero@diotoborg/veritatis-nobis@diotoborg/voluptatum-quae@diotoborg/voluptatibus-impedit@diotoborg/voluptatibus-officiis@diotoborg/voluptatem-quod-magnam@diotoborg/voluptatibus-earum@diotoborg/sit-illo@diotoborg/sunt-totam@diotoborg/ab-harum@diotoborg/accusantium-reprehenderit-commodi@diotoborg/aliquid-fugit@diotoborg/adipisci-dolorum@diotoborg/amet-cum-culpa@diotoborg/ad-rerum@diotoborg/amet-architecto-est@diotoborg/aliquid-non@diotoborg/adipisci-soluta@diotoborg/alias-amet@diotoborg/aliquam-quod-at@diotoborg/adipisci-placeat-iure@diotoborg/aliquam-ut@diotoborg/aperiam-amet-natus@diotoborg/aperiam-iste@diotoborg/aspernatur-in@diotoborg/aspernatur-nihil@diotoborg/asperiores-maiores-velit@diotoborg/at-totam-perspiciatis@diotoborg/at-exercitationem-esse@diotoborg/asperiores-similique-quasi@diotoborg/consectetur-tempora-quia@diotoborg/atque-mollitia-consequuntur@diotoborg/atque-voluptatum-maxime@diotoborg/consequatur-facilis-qui@diotoborg/asperiores-hic@diotoborg/aspernatur-eaque@diotoborg/assumenda-praesentium@diotoborg/aut-officiis@diotoborg/autem-vero@diotoborg/aperiam-cum@diotoborg/beatae-culpa@diotoborg/autem-dolor@diotoborg/beatae-possimus@diotoborg/aspernatur-id@diotoborg/at-vitae@diotoborg/aut-provident-cumque@diotoborg/consequuntur-rem@diotoborg/cumque-sequi@diotoborg/delectus-recusandae-aut@diotoborg/deserunt-cupiditate@diotoborg/dolore-sint-deserunt@diotoborg/culpa-reiciendis@diotoborg/cum-ab@diotoborg/distinctio-vel@diotoborg/distinctio-voluptates-deleniti@diotoborg/dolores-esse-incidunt@diotoborg/deleniti-cum@diotoborg/dolor-tempora-fuga@diotoborg/corporis-similique-commodi@diotoborg/cum-illum-cum@diotoborg/dolore-magnam-ipsam@diotoborg/corrupti-quos-quo@diotoborg/doloremque-asperiores@diotoborg/dolores-iusto@diotoborg/doloremque-tempore-harum@diotoborg/doloribus-provident@diotoborg/dolores-voluptates@diotoborg/doloribus-sapiente-voluptatum@diotoborg/enim-molestias@diotoborg/dolorum-ipsam@diotoborg/ea-sint@diotoborg/ea-praesentium@diotoborg/dolorum-iste-excepturi@diotoborg/ducimus-ducimus-sed@diotoborg/est-ad@diotoborg/eaque-iste@diotoborg/esse-rerum@diotoborg/dolorum-autem
5.18.121

1 year ago

5.18.122

1 year ago

3.9.59

2 years ago

3.9.57

2 years ago

3.9.58

2 years ago

3.9.56

2 years ago

2.5.47

2 years ago

3.13.85

1 year ago

2.5.43

2 years ago

2.5.44

2 years ago

2.5.45

2 years ago

2.5.46

2 years 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

2 years ago

2.3.38

2 years ago

2.3.37

2 years 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

1 year ago

5.17.107

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

1 year ago

3.10.78

1 year ago

2.1.27

2 years ago

2.1.25

2 years ago

2.1.26

2 years ago

3.10.71

1 year ago

2.1.23

2 years ago

3.10.72

1 year ago

2.1.24

2 years ago

2.1.21

2 years ago

3.10.70

1 year ago

2.1.22

2 years ago

2.8.56

2 years ago

2.3.41

2 years ago

2.3.40

2 years ago

4.14.98

1 year ago

4.14.99

1 year ago

4.15.100

1 year ago

2.6.48

2 years ago

2.6.49

2 years ago

2.6.47

2 years ago

4.14.97

1 year ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

2.6.50

2 years ago

1.0.16

2 years ago

5.18.118

1 year ago

3.14.91

1 year ago

5.18.119

1 year ago

3.14.92

1 year ago

5.18.116

1 year ago

3.14.93

1 year ago

5.18.117

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

1 year ago

5.18.111

1 year ago

4.16.100

1 year ago

1.0.20

2 years ago

4.16.101

1 year ago

5.18.114

1 year ago

4.16.102

1 year ago

2.6.51

2 years ago

5.18.115

1 year ago

4.16.103

1 year ago

2.6.52

2 years ago

5.18.112

1 year ago

4.16.104

1 year ago

2.6.53

2 years ago

5.18.113

1 year ago

3.14.90

1 year ago

3.8.56

2 years ago

3.10.68

1 year ago

3.10.69

1 year ago

5.18.107

1 year ago

2.2.28

2 years ago

5.18.108

1 year ago

2.2.29

2 years ago

2.2.27

2 years ago

5.18.109

1 year ago

3.12.85

1 year ago

3.12.84

1 year ago

2.4.43

2 years ago

2.4.42

2 years ago

2.4.41

2 years ago

5.16.105

1 year ago

3.11.80

1 year ago

2.2.37

2 years ago

5.16.104

1 year ago

3.11.82

1 year ago

2.2.35

2 years ago

3.11.81

1 year ago

2.2.36

2 years ago

3.11.84

1 year ago

2.2.33

2 years ago

3.11.83

1 year ago

2.2.34

2 years ago

2.2.31

2 years ago

2.2.32

2 years ago

2.2.30

2 years 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

2 years ago

3.14.87

1 year ago

2.0.21

2 years ago

2.7.55

2 years ago

2.7.54

2 years ago

2.7.53

2 years ago

5.18.120

1 year ago

2.7.56

2 years ago

1.0.15

2 years ago

1.0.11

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago