4.8.156 • Published 11 months ago

@firanorg/neque-est-dolorum v4.8.156

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

11 months ago

4.8.155

11 months ago

4.8.154

11 months ago

4.8.152

11 months ago

4.8.153

11 months ago

4.8.151

11 months ago

4.6.147

11 months ago

4.6.148

11 months ago

4.6.145

11 months ago

4.6.146

11 months ago

4.7.148

11 months ago

4.7.149

11 months ago

4.7.150

11 months ago

4.7.151

11 months ago

4.6.138

11 months ago

4.6.139

11 months ago

4.6.143

11 months ago

4.6.144

11 months ago

4.6.141

11 months ago

4.6.142

11 months ago

4.6.140

11 months ago

4.6.136

11 months ago

4.6.137

11 months ago

4.6.134

12 months ago

4.6.135

11 months ago

4.6.133

12 months ago

3.6.128

12 months ago

3.6.129

12 months ago

3.6.127

12 months ago

4.6.129

12 months ago

4.6.132

12 months ago

4.6.130

12 months ago

4.6.131

12 months ago

3.6.126

12 months ago

3.6.125

12 months ago

3.6.124

12 months ago

3.6.123

12 months ago

2.6.123

12 months ago

2.6.122

12 months ago

2.5.122

12 months ago

2.5.120

12 months ago

2.5.121

12 months ago

2.4.120

12 months ago

2.4.119

12 months ago

2.4.118

1 year ago

2.4.117

1 year ago

2.4.116

1 year ago

2.4.115

1 year ago

2.4.114

1 year ago

2.4.113

1 year ago

2.4.112

1 year ago

2.4.111

1 year ago

2.4.110

1 year ago

2.4.109

1 year ago

2.4.108

1 year ago

2.4.107

1 year ago

2.4.106

1 year ago

2.4.105

1 year ago

2.4.87

1 year ago

1.3.68

1 year ago

2.4.86

1 year ago

1.3.69

1 year ago

2.4.89

1 year ago

2.4.88

1 year ago

1.1.49

1 year ago

2.4.85

1 year ago

2.4.90

1 year ago

2.4.92

1 year ago

1.0.39

1 year ago

2.4.91

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

1 year ago

1.2.67

1 year ago

1.0.44

1 year ago

2.4.97

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

1 year ago

1.2.66

1 year ago

1.0.41

1 year ago

2.4.94

1 year ago

1.0.48

1 year ago

2.4.93

1 year ago

1.0.47

1 year ago

2.4.96

1 year ago

1.0.46

1 year ago

2.4.95

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

1 year ago

2.3.78

1 year ago

2.3.75

1 year ago

1.0.33

1 year ago

2.3.74

1 year ago

1.0.32

1 year ago

2.3.77

1 year ago

1.0.31

1 year ago

2.3.76

1 year ago

1.0.30

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

2.3.73

1 year ago

1.0.35

1 year ago

2.3.72

1 year ago

1.0.34

1 year ago

2.3.80

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

1 year ago

1.1.55

1 year ago

1.1.54

1 year ago

1.1.53

1 year ago

2.3.82

1 year ago

2.3.81

1 year ago

1.1.59

1 year ago

2.3.84

1 year ago

1.1.58

1 year ago

2.3.83

1 year ago

1.1.57

1 year ago

2.4.104

1 year ago

2.4.103

1 year ago

2.4.102

1 year ago

2.4.101

1 year ago

2.4.100

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