1.0.14 • Published 2 days ago

@firanorg/neque-est-dolorum v1.0.14

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

2 days ago

1.0.13

3 days ago

1.0.12

4 days ago

1.0.11

5 days ago

1.0.10

6 days ago

1.0.9

7 days ago

1.0.8

8 days ago

1.0.7

9 days ago

1.0.6

10 days ago

1.0.5

11 days ago

1.0.4

12 days ago

1.0.3

13 days ago

1.0.2

14 days ago

1.0.1

15 days ago

1.0.0

16 days ago