4.8.156 • Published 9 months ago

@firanorg/neque-est-dolorum v4.8.156

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

@firanorg/neque-est-dolorum 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('@firanorg/neque-est-dolorum');
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

sharedtoolkitprotomake dirarraybufferReflect.getPrototypeOfvariablescolorthroatvalidationiterationECMAScript 6offsetguidjesttypedarraysemitsetparsertaskgroupeast-asian-widthes2017includesreadoncestreams2tapcss lessomitless.jsinReactiveXfetchfull-widthcontainswritablecall-boundjsxspinnerstypeflagcolumncheckmixinsES6datehotmimetypesECMAScript 2015BigInt64Arrayoutputstylescopynamesconnectreact-hooksWeakSetfast-deep-copytostringtagtapestreamsgradients cssregexdescriptorhandlersES2015dirreact-testing-libraryUint8ArrayTypedArrayassigncss variabletimecolorswalkingformattingYAMLcensorregular expressionES7browserliststylingregexpbcryptjsdomidsortserializationlibphonenumberless compilertextargsInt16Arrayruntimeform-validationweakmapfindObjectkoreancorssymbolargparsetraverserateeveryredux-toolkitcacheequaldeletelimitedforEachmiddlewaresideminimalcss-in-jsfluxWebSocketansivisualSymbolgetOwnPropertyDescriptorcryptoconcatECMAScript 3formlistenerscolourtermjQuerypositiveentriesrecursivearktypeArray.prototype.flattencharactersdomkeypropertieshasqueueMicrotaskUint8ClampedArraytelephoneeslint-pluginparsebrowserjwtastES2016workflowrouteArrayBuffer.prototype.sliceES2020parentmochaserializeoperating-systemes-abstractglacierfindLastIndexmkdirputilityescapestylesheetRxString.prototype.trim.envdefinePropertyqses2015ES2018extensionexitcode pointsparsingsomedeepclonettytaketypedarraygdprObject.keysinterruptsenvmkdirsloggerpropinputwriteWeakMap$.extendES2019eventseventDispatcheridlees2016assertUint16Arrayjsairbnbchromiumutil.inspecthttpssnsxhrargvutillintStyleSheetgetintrinsicrangeerrorappECMAScript 2016preprocessorES3xtermtrimStartUint32Arrayjoilookclassnamestyped arraymetadatanested cssshellyupFloat32ArraystatelesssetPrototypeOfemojifullReactiveExtensionswgetclassesES2023dataArray.prototype.flatRegExp.prototype.flagsnumberupimportexporterror-handlingdataviewlessreal-timesqswrapstoragegatewayes7linuxObject.assignargumentes6[[Prototype]]isConcatSpreadablefind-upaccessorhooksowngetPrototypeOfchannelreduceflattenlinkless csspredictablesignalString.prototype.matchAlllastes-shimsutilitiesbundlercollectionreplayarrayTypeBoxrm -rfStreamsajaxperformancepromiseswordwrappnpm9CSSshammapoptimistlinewrapsettingsmkdires-shim APIelasticacheponyfillObservableec2watchFilewafECMAScript 2018getimmergetterRxJScssprotobufamazoncoerciblesortedroute53speedinternal slot-0ES2017equalityratelimitthrottledescriptionphoneeslintawaitexit-codeeslintconfigkarmabundlingdefineclass-validatorprettycurlinferenceloadingfast-cloneprunejapanesetoobjectswfduplexfiltermimeassertionpipecliterminalcomputed-typesECMAScript 5batchObject.isprotocol-bufferstypescriptArray.prototype.containstc39i18nES8resttrimLeftprototypemobiletslibstringviewartsigtermdotenvcharacterdom-testing-libraryelblogcomparebootstrap cssvalidmoveECMAScript 2017jasminetypesafeendersignalsmomentfpscloneextraES2021whichserializerArray.prototype.filterroutingquoteautoprefixerfunctionstoStringTagECMAScript 7progressfsissearchwaitwatchingiteratordayjsoptimizerpluginbuffersbindsuperagenttypeerrorpackagecalllengthRegExp#flagsawsarraysclassnamees5deterministicECMAScript 2021matchesresolvenopegradients css3encryptionpackagesreactmonoreporeducerwebpersistentconfigurablefile systemcreatejsonpathJSONaccessibility__proto__functionalrandomdataViewscheme-validationBigUint64ArraywarningsetterbrowsersliststatusURLenvironmentqueuesyntaxArray.prototype.flatMapimmutablesigintSymbol.toStringTagfigletflatMapobjmime-dbindicatorremoveMicrosoftestreediffpackage.jsonFloat64Arrayebsdeepcopydynamodbpushbytepostcss-plugincompile lessmrurfc4122ecmascriptInt8ArrayglobcompilerenumerablermdiruninstallfastifyRFC-6455descriptorsurlnegative zeroconcurrencyESnexttddinstallerstdlibrmfastcopycallboundObject.fromEntriescodescloudformationfolderemrtoSortedasciidatastructureobjecttypedtrimconsumepolyfillObject.valuesesvaluehelpersPromisedirectoryECMAScript 2022variables in csscircularvestfast-copyspecjsonajvloadbalancingkeysES5typanionsameValueZeroObject.getPrototypeOfsyntaxerrorproxyweaksetpackage managerconsolevalueses2018invariantpyyamlopenschemamakeAsyncIteratorendpointparentsrequiremoduleArray.prototype.includesCSSStyleDeclarationreadablestreamregular expressionswalkcall-bindeslintpluginhookformzerogroupByrestfulstringifierlockfilefastclonerobustcjkauthenticationArraycloudwatchspinnermacosshimbreakiterateexecimportautoscalingslotpostcssmodulessymlinkloggingefficientrgbfixed-widthinstallintrinsicJSON-SchemalimitzodsetImmediatedeepnativeInt32ArrayquerystringbusyagentFunction.prototype.nameelectronfseventsl10nworkspace:*callbindbluebirdsesdebuggerfullwidthfunctiontouch0testingstylebddtoolsgenericsnpmcommandcolumnsformsbuffertypeofdebugelmkinesishigher-orderpropertyes8errorfast-deep-clonefromeventEmitterhardlinksrm -frstyleguidereact-hook-formreuses3privatecallbackArrayBuffer#sliceECMAScript 2020promiseoptionESschemepatchcommanderquerystructuredClonecss nestinghasOwntrimRightwindowsiewhatwgdeep-copyObject.entriesgetoptirqrdsperformanthasOwnPropertyfindupcloudfrontmatchpreserve-symlinkscollection.es6dependency managersuperstructArray.prototype.findLastawesomesaucemapreducelazybootstrap lessmulti-packageES2022symlinkschromeslice_.extendIteratorstreamECMAScript 2019reduxvalidate@@toStringTagfileprivate datasharedarraybufferboundlesscssexpressionhttprouter
4.8.156

9 months ago

4.8.155

9 months ago

4.8.154

9 months ago

4.8.152

9 months ago

4.8.153

9 months ago

4.8.151

9 months ago

4.6.147

10 months ago

4.6.148

9 months ago

4.6.145

10 months ago

4.6.146

10 months ago

4.7.148

9 months ago

4.7.149

9 months ago

4.7.150

9 months ago

4.7.151

9 months ago

4.6.138

10 months ago

4.6.139

10 months ago

4.6.143

10 months ago

4.6.144

10 months ago

4.6.141

10 months ago

4.6.142

10 months ago

4.6.140

10 months ago

4.6.136

10 months ago

4.6.137

10 months ago

4.6.134

10 months ago

4.6.135

10 months ago

4.6.133

10 months ago

3.6.128

10 months ago

3.6.129

10 months ago

3.6.127

10 months ago

4.6.129

10 months ago

4.6.132

10 months ago

4.6.130

10 months ago

4.6.131

10 months ago

3.6.126

10 months ago

3.6.125

10 months ago

3.6.124

10 months ago

3.6.123

10 months ago

2.6.123

10 months ago

2.6.122

10 months ago

2.5.122

10 months ago

2.5.120

11 months ago

2.5.121

10 months ago

2.4.120

11 months ago

2.4.119

11 months ago

2.4.118

11 months ago

2.4.117

11 months ago

2.4.116

11 months ago

2.4.115

11 months ago

2.4.114

11 months ago

2.4.113

11 months ago

2.4.112

11 months ago

2.4.111

11 months ago

2.4.110

11 months ago

2.4.109

11 months ago

2.4.108

11 months ago

2.4.107

11 months ago

2.4.106

11 months ago

2.4.105

11 months ago

2.4.87

12 months ago

1.3.68

1 year ago

2.4.86

12 months ago

1.3.69

1 year ago

2.4.89

12 months ago

2.4.88

12 months ago

1.1.49

1 year ago

2.4.85

12 months ago

2.4.90

12 months ago

2.4.92

11 months ago

1.0.39

1 year ago

2.4.91

12 months ago

1.0.38

1 year ago

1.2.63

1 year ago

1.0.40

1 year ago

1.2.64

1 year ago

2.4.98

11 months ago

1.2.67

1 year ago

1.0.44

1 year ago

2.4.97

11 months ago

1.2.68

1 year ago

1.0.43

1 year ago

1.2.65

1 year ago

1.0.42

1 year ago

2.4.99

11 months ago

1.2.66

1 year ago

1.0.41

1 year ago

2.4.94

11 months ago

1.0.48

1 year ago

2.4.93

11 months ago

1.0.47

1 year ago

2.4.96

11 months ago

1.0.46

1 year ago

2.4.95

11 months ago

1.0.45

1 year ago

1.0.49

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

2.3.79

12 months ago

2.3.78

12 months ago

2.3.75

12 months ago

1.0.33

1 year ago

2.3.74

12 months ago

1.0.32

1 year ago

2.3.77

12 months ago

1.0.31

1 year ago

2.3.76

12 months ago

1.0.30

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

2.3.73

12 months ago

1.0.35

1 year ago

2.3.72

1 year ago

1.0.34

1 year ago

2.3.80

12 months ago

1.3.71

1 year ago

1.3.72

1 year ago

1.3.70

1 year ago

1.1.52

1 year ago

1.1.51

1 year ago

1.1.50

1 year ago

1.1.56

1 year ago

2.3.85

12 months ago

1.1.55

1 year ago

1.1.54

1 year ago

1.1.53

1 year ago

2.3.82

12 months ago

2.3.81

12 months ago

1.1.59

1 year ago

2.3.84

12 months ago

1.1.58

1 year ago

2.3.83

12 months ago

1.1.57

1 year ago

2.4.104

11 months ago

2.4.103

11 months ago

2.4.102

11 months ago

2.4.101

11 months ago

2.4.100

11 months ago

1.1.63

1 year ago

1.1.62

1 year ago

1.1.61

1 year ago

1.1.60

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