3.13.124 • Published 10 months ago

@patrtorg/eveniet-tempore-maiores v3.13.124

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

typed-array-byte-offset 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('typed-array-byte-offset');
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

readablestreamwgetFloat64ArrayfastcopyECMAScript 2015flattenpathassignbatchlookiammimeeslintconfigvestastdefinejson256javascript_.extendArrayBuffer#slice.envtrimEndpostcssasciisortES7flatfullvisualtoArrayinputcolumnsvaluefind-upoptimizerprotobuftslibreact-hookslessRxJSjasmineCSSes-shim APIFloat32ArraystylesgetintrinsicdeepclonetextuninstallPromisees8variables in csstaskimmutabledommatchAllpropertiescallboundtrimRightawaiteveryforEachObject.keysarktypetostringtagmapes-shimssharedarraybufferpredictablees6ECMAScript 2020mapreducegetPrototypeOfcacheconnecteventsscheme-validationjsdoma11ywidtharraybufferbundlercallbackhigher-ordernpmworkersymlinkspicomatchESnextstableWeakSetObject.assignUint8ArrayschemalocationparentspromisesWebSocketsetfast-copyES2015fastifycorseslintnumberflatMaprfc4122datetesterreact-testing-libraryoffsetpropertysideexecprotocol-buffersfunctionaldependency managerArrayBuffer.prototype.slicegetterArray.prototype.findLastIndexcolumn$.extendphonecryptStreamsavafull-widthgroupgradients css3dayjssafeclassnameshebangapollofast-deep-copyWebSocketstoolkitponyfillJSON-SchemastructuredCloneisConcatSpreadablegettypeofcoercibledeepcopypositiveargumentsomenamesregularsetterprogressUnderscoreinstallerobjectArray.prototype.findLastcloudfrontvalidunicodeawsObservablesindicatorsescommandes2016matchdataViewcss variablehelpersfunctionselasticacheguideslint-pluginsameValueZerorgbHyBihas-ownrangeerrorcolorUint8ClampedArraydeep-copysetPrototypeOfinstallrmcommandertoolstoSortedoptioncorextermtypedarrayTypeBoxclass-validatormobilecssform-validationloadbalancingextraconsolenegativesuperagentfast-deep-cloneES2018simpledbxhrES2021deepwebECMAScript 3assertionmochaiteratorwatchFilebufferargparseemitsnsidlees-abstractbyteOffsetprettytouchratelimitqsglobelectrontsemrsequencedrophttpsjQueryArray.prototype.flatMaputil.inspectbusypackagewalkObject.ismonoreporegular expressionclassesmakeECMAScript 2018toobjectreducerloghasOwnhooksjsimmerminimalObject.getPrototypeOfkeydescriptorsObject.entriesjsdiffdom-testing-librarystringifierfigletamazonajvmatchesweakmapregular expressionsconsumecomparegetOwnPropertyDescriptorfetchcharacterender__proto__authperformantfixed-widthfile systemfast-cloneformsbreakespreedotenvmruqueueMicrotaskassertsautoprefixercallbindurlAsyncIteratorencryptionstyled-componentsoncehardlinksES8copyclassnamesflagdescriptoresmimetypesinternal slotdirectoryString.prototype.trimendpointjwtArrayBigUint64ArrayTypedArrayes5regexpless.jselmawesomesauceconfigiterationlook-uppluginrecursiveMapfromserializationlazyquoteIteratorruntimekoreanmkdirgdprtypesredirectStyleSheetsymbolefficientdeep-clonedependenciesfindhasfindupdatastructuretypedbundlingReactiveXratenodejscompile lessshimparserchaivariablesshrinkwrapwalkingwhichES3loadingwordbreakarrayscjkomittypedarraysqueueObservablefpserrorURL[[Prototype]]queryreadablesharedcloudtrailfullwidthECMAScript 2019functionwordwrapassertcloudformationpushterminalemojimoveArray.prototype.containsinternallinewrapfindLastIndexreal-timewatcherECMAScript 2021es7readpackagespatchjoibrowserliststylemkdirsjapaneseES2016compilerestreeshamieESStreamstringifytrimreactincludesmergecloudwatchlastsortedReflect.getPrototypeOfjsonpatheventDispatchertestides2015slicesyntaxec2redux-toolkitcss lessspeedzodexpressloggercall-boundcliownformattinglesscssoptimisteast-asian-widthparseECMAScript 6glacierdeletePushformfindLastcontainsreact-hook-formsyntaxerrorprotomulti-packagestoragegatewaykeystelephoneECMAScript 2023preserve-symlinksmime-dbcharacterscss-in-jsworkspace:*ECMAScript 2016httpstyleguideproxylimitedECMAScript 7replaygenericsboundkinesisobjtraverseInt16Arrayenvconcurrencyserializepackage.jsontypescriptquerystringbrowserdescriptionstringduplexbluebirdcallisformatpnpm9middlewarepipeparentecmascriptObject.fromEntriescensorcodesless mixinsansiObject.valuestestingfsprototypebootstrap lesspropspinneraccessorremovel10nRegExp#flagsdataviewweaksettermObjectrmdirapiObject.definePropertywhatwgbootstrap csstoStringTaglength-0chinesemake dires2018RegExp.prototype.flagsliveURLSearchParamsRxECMAScript 5inspectescapespecschememomentgroupByinferenceJSONfluxdataES6shellstylingsetImmediatelockfilebyteLengthtakeES2017stdlibMicrosoftbindroute53argv0importexportutilitiesArray.prototype.flattenlibphonenumberrm -rfmkdirputilitywrapcolourinvariantSymbol.toStringTagimportwritemixinsInt8ArraybytebddnameES2023postcss-pluginworkflowthrottlesearchnativeclonecloudsearchbrowserslistcss nestingWeakMaprequestregexchromerdsyupresolvenopeYAMLreduceUint16ArraybuffersES5symbols@@toStringTagstreams2robustwritablehasOwnPropertypruneperformancecolorsviewarts3airbnbrouteprivatefolderajaxpackage managerslotUint32Arrayio-tscollection.es6upReactiveExtensionspreprocessorpolyfillrequireprefixstylesheetvpcautoscalingfilei18ncurltypanionpersistentcollectiontrimLeftES2020passwordinrm -frES2022redactebsnodereduxequalitywatchingcryptogetopteventEmitterfseventsES2019lrucode pointsloggingconfigurablereusesettingsroutingttyoutputarrayaccessibilityargsutillanguagecommand-lineInt32Arraycall-bindrapidhookformstateSetuuidagentcircularelbArray.prototype.flatjestdiffcreatevalidationless compilerdirdefinePropertyextensiones2017watchcheckswfbcryptsuperstructtapesqsgradients css
@patrtorg/numquam-doloribus-sit@patrtorg/doloribus-aperiam@patrtorg/dolorum-blanditiis@patrtorg/dolorum-quisquam-molestias@patrtorg/eaque-tempore-temporibus@patrtorg/ducimus-hic@patrtorg/eaque-dolorem-iusto@patrtorg/enim-culpa@patrtorg/enim-quas@patrtorg/est-corrupti@patrtorg/est-corrupti-deleniti@patrtorg/error-expedita-rerum@patrtorg/esse-ut@patrtorg/esse-occaecati-quos@patrtorg/ex-iure@patrtorg/expedita-deleniti-ratione@patrtorg/expedita-eaque-at@patrtorg/fugiat-beatae-quas@patrtorg/fugiat-perspiciatis@patrtorg/fugit-cumque@patrtorg/illo-saepe@patrtorg/hic-facere-ratione@patrtorg/itaque-beatae@patrtorg/iste-sunt@patrtorg/iure-at@patrtorg/labore-nemo-impedit@patrtorg/magnam-aut-adipisci@patrtorg/molestiae-nulla-architecto@patrtorg/modi-aut-dolorem@patrtorg/modi-officia-iusto@patrtorg/nihil-at@patrtorg/nihil-vero-ipsa@patrtorg/pariatur-sapiente@patrtorg/quia-laborum-porro@patrtorg/qui-dolore@patrtorg/quidem-dolore@patrtorg/qui-omnis-voluptates@patrtorg/similique-nam@patrtorg/sed-laudantium-nemo@patrtorg/sapiente-sed-eius@patrtorg/sapiente-eos-magnam@patrtorg/sed-veritatis-placeat@patrtorg/soluta-quo@patrtorg/nisi-perferendis@patrtorg/perspiciatis-possimus@patrtorg/quo-cupiditate-sit@patrtorg/saepe-tenetur-iusto@patrtorg/repellendus-ex@patrtorg/repudiandae-dolore@patrtorg/repellat-quam@patrtorg/tempora-quas@patrtorg/tempore-cumque@patrtorg/vero-quibusdam-ipsa@patrtorg/maiores-adipisci-maxime@patrtorg/nostrum-beatae-a@patrtorg/nobis-assumenda-optio@patrtorg/nobis-nobis@patrtorg/quas-sed-id@patrtorg/reiciendis-doloribus-officia@patrtorg/soluta-numquam@patrtorg/soluta-et@patrtorg/neque-consectetur@patrtorg/neque-voluptatem@patrtorg/odit-facere@patrtorg/officiis-qui@patrtorg/odio-ratione@patrtorg/officiis-dolorum@patrtorg/quos-hic@patrtorg/similique-vero-sapiente@patrtorg/sit-ipsam-dolore@patrtorg/suscipit-sit-culpa@patrtorg/tempora-impedit-dolore@patrtorg/porro-voluptates@patrtorg/quod-asperiores@patrtorg/tenetur-aut@patrtorg/tempore-labore-mollitia@patrtorg/totam-accusamus@patrtorg/veritatis-vel-amet@patrtorg/veritatis-ad-voluptates@patrtorg/occaecati-reiciendis-reiciendis@patrtorg/pariatur-repellendus-aspernatur@patrtorg/quo-in@patrtorg/sunt-distinctio-illo@patrtorg/sunt-asperiores@patrtorg/ullam-eum@patrtorg/ullam-doloremque@patrtorg/unde-cupiditate@patrtorg/animi-laboriosam-adipisci@patrtorg/aperiam-quaerat@patrtorg/aspernatur-assumenda@patrtorg/aspernatur-dolorum-ducimus@patrtorg/architecto-laudantium@patrtorg/aspernatur-repellendus-assumenda@patrtorg/assumenda-officia@patrtorg/assumenda-qui@patrtorg/assumenda-ipsam@patrtorg/aspernatur-laborum@patrtorg/at-sunt-itaque@patrtorg/commodi-illo@patrtorg/beatae-quas
3.11.111

10 months ago

3.11.110

10 months ago

3.10.97

11 months ago

3.10.98

11 months ago

3.10.95

11 months ago

3.10.96

11 months ago

3.10.99

11 months ago

1.6.40

1 year ago

1.6.42

1 year ago

1.6.41

1 year ago

1.6.44

1 year ago

1.6.43

1 year ago

1.6.46

1 year ago

1.6.45

1 year ago

3.11.109

11 months ago

1.4.24

1 year ago

3.11.108

11 months ago

1.4.23

1 year ago

3.11.107

11 months ago

1.4.26

1 year ago

3.11.106

11 months ago

1.4.25

1 year ago

3.11.105

11 months ago

1.4.28

1 year ago

3.11.104

11 months ago

1.4.27

1 year ago

1.4.29

1 year ago

3.13.114

10 months ago

3.13.118

10 months ago

3.9.68

12 months ago

3.13.117

10 months ago

3.9.69

12 months ago

3.13.116

10 months ago

3.9.66

12 months ago

3.13.115

10 months ago

3.9.67

12 months ago

3.13.119

10 months ago

1.4.31

1 year ago

1.4.30

1 year ago

1.4.33

1 year ago

1.4.32

1 year ago

1.4.34

1 year ago

3.13.121

10 months ago

3.13.120

10 months ago

3.8.65

12 months ago

3.8.66

12 months ago

3.8.63

12 months ago

2.8.56

1 year ago

3.8.64

12 months ago

1.1.16

1 year ago

2.8.59

1 year ago

1.1.15

1 year ago

2.8.58

1 year ago

2.8.57

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

2.8.63

1 year ago

2.8.62

1 year ago

2.8.61

1 year ago

2.8.60

1 year ago

2.6.48

1 year ago

2.6.46

1 year ago

1.6.39

1 year ago

2.6.47

1 year ago

1.6.38

1 year ago

3.12.111

10 months ago

3.9.90

11 months ago

1.5.34

1 year ago

1.5.36

1 year ago

1.5.35

1 year ago

3.9.95

11 months ago

1.5.38

1 year ago

1.5.37

1 year ago

3.9.93

11 months ago

3.9.94

11 months ago

3.9.91

11 months ago

3.9.92

11 months ago

1.3.19

1 year ago

3.10.104

11 months ago

3.10.103

11 months ago

3.12.113

10 months ago

3.12.112

10 months ago

3.12.114

10 months ago

1.3.20

1 year ago

1.3.21

1 year ago

1.3.22

1 year ago

1.3.23

1 year ago

3.13.124

10 months ago

3.13.123

10 months ago

1.2.18

1 year ago

3.13.122

10 months ago

1.2.19

1 year ago

3.9.79

12 months ago

3.9.77

12 months ago

3.9.78

12 months ago

3.10.100

11 months ago

3.10.102

11 months ago

3.10.101

11 months ago

2.7.49

1 year ago

3.9.75

12 months ago

3.9.76

12 months ago

3.9.73

12 months ago

3.9.74

12 months ago

3.9.71

12 months ago

2.7.48

1 year ago

3.9.72

12 months ago

3.9.70

12 months ago

2.7.51

1 year ago

2.7.50

1 year ago

3.9.88

11 months ago

3.9.89

11 months ago

3.9.86

11 months ago

2.7.55

1 year ago

3.9.87

11 months ago

2.7.54

1 year ago

3.9.84

11 months ago

2.7.53

1 year ago

3.9.85

11 months ago

2.7.52

1 year ago

3.9.82

11 months ago

3.9.83

11 months ago

3.9.80

12 months ago

3.9.81

12 months ago

2.7.56

1 year ago

1.1.14

1 year ago

1.0.11

1 year ago

1.0.13

1 year ago

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