2.1.9 • Published 5 days ago

@diotoborg/est-unde-excepturi v2.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

@diotoborg/est-unde-excepturi 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/est-unde-excepturi');
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

Object.entriesexecfile@@toStringTagarraysinternalkeycomparecmdieurlsArrayBuffer#slicebeanstalkgetnegative zerosorttoStringTagfast-deep-copykoreanbreakrecursivecloudformationsetmomentapicontainsUint16ArraylocationtoobjectcjkbluebirdargumentexecutetranspilerpackageslinewrapmoduleregexpString.prototype.matchAllfunctionses2018rapidES2016hardlinksstringifierlintArrayBuffer.prototype.sliceexpresstraverseprivate datamulti-packagehashstdlibworkflowdebugfromautoprefixerconcatdropemrtoArraywhichassignlaunchfindweakmapopenspeedECMAScript 2022mimeroutingargsapollodatadependenciescurlUint32ArrayoptimistdatastructureES2021react animationsymbolreact-hooksString.prototype.trimtoSortednumber__proto__RxJSregexopenscorexmlgesturesdebuggercallbindInt32ArraymapObject.ishookstestercompilerisConcatSpreadablemapreduceelbSetexpressionReactiveXbatchmonorepomochabyteLengthes-abstractregularstreamsECMAScript 6make dirnativecloudwatchtsspecsharedarraybufferwrapchaisetPrototypeOfpropertyfixed-widthchinesefastcloneurlwritablestyled-componentsdragprefixcolorprocessECMAScript 5boundanimationes-shimsl10nisObject.getPrototypeOfthrottleUint8Arrayreact-testing-librarycolorsdeepESAsyncIteratorrm -frmatchkinesisjoitakedeletedeepcloneformsproxysymlinkinvariantbrowserslistidentifierscryptocheckES2018styleoptionInt8Arrayagentregular expressionsassertiontimecharactersquerypolyfillformatlanguagetypeerrorfeedMicrosofti18nmatchAllmodulesreducenamespromisesgetOwnPropertyDescriptorwalkpatchtransformhigher-orderArrayBuffercssrgbrdsglobalECMAScript 2019flatcloneajvserializerpromisedescriptoriterateredactESnextnamePromiseasyncroute53somegetterdependency managermimetypes.envtddenvironmentstypescriptflatMapinspectmetadataHyBireadablespringes8mime-dbwordwrapawsgetoptArray.prototype.flattenperformancebinexecutablefast-copyopenerconcurrencyqueueemojiajaxsource mapvaluesjsondefaultrandomminimalpnpm9graphql-clienthttpsschemastyleguideefficientextracollectionjQueryinternal slotsymbolsloadingsuperstructloadbalancingtrimRightStreamtrimEndArraykarmaaccessorObject.fromEntriestypedslotmkdirpyamlFunction.prototype.nameArray.prototype.containsES2019sespushBigInt64ArraysetImmediatequoteio-tstypeofemitstableES2017everyECMAScript 7bufferonceendpointargventrieswafcolumnclientfolderstylesprettyjscircularframerdeepcopyfilecloudfrontsidetc39electronprotocol-buffersxhrpropertiesrmrateincludesmakeprototyperegular expressionpropprotobuf_.extendYAMLsortedjsdiffexecamazonttyintrinsicwebsitedescriptorsvarss3serializationFloat32ArraycommandespreeparsedotenvtoolsPushpostcssstartbusyES2020byteOffsetparentsterminalwaapiasciiparsingviewURLSearchParamsxtermremoveforEachinstallerapphasdefinePropertyeventEmitterzodelasticachesimpledbdiffWeakMapvalidationlastslicesqsrssfpsArray.prototype.findLastoptimizercode pointsCSSStyleDeclarationmanipulationTypeScriptsuperagentindicatorgenericsdirectoryes2017linkcloudtrailpreprocessorargumentsfull-widthpluginpipeimportwgetcolourreworkpyyamlreadablestreamunicodeWeakSettelephonelookES2022symlinksfunctionsafeschemeowninECMAScript 2020assertextendponyfillreact-hook-formgroupByObservableshasOwneventsglobalspicomatchES2023shammkdirequalityweaksetbrowserspinnersjestECMAScript 2021posecollection.es6omitformchildvpchas-ownutilityfastoffsetinferencecreatevalueextensionES3local0dynamodbdaterm -rfequalreal-timefile systemsyntaxidpathbundlerformattingerrorCSScodesES5atomfast-clonestarterArray.prototype.flatMapTypeBoxiterator$.extendshebangecmascriptdataViewdescriptionvalidarktypeuuideslint-pluginIteratorECMAScript 2017hookformestrimsnslruArray.prototype.findLastIndexBigUint64ArraystringconcatMapawesomesaucebddparserbindguidmobileRxthreeinstallrangeerror3dcommand-linechromevalidatecore-jsenumerableyuppreserve-symlinksendergraphqltextestreefunctionalECMAScript 2016testinggdprzxpositiveRegExp#flagsgroupredux-toolkitec2rfc4122fastifyrobustserializecomputed-typesdom-testing-librarydayjsphonejavascriptObject.assignstreams2htmlcliworkspace:*configpostcss-plugintyped arraydataviewreduxworkerruntimetypesafees2015columnshelperobjectfind-upflattenfilterRegExp.prototype.flagsnodecommandercallbacklook-uptapesetterlistenersenveventDispatcherpersistentxdg-openescapepackagefindLastIndexStyleSheetfullgetintrinsiclogArray.prototype.filtertslibxdgnodejsconsumeclass-validatorshrinkwrapjshinttaskArray.prototype.includes[[Prototype]]ES8ECMAScript 2023censorshellES7Reflect.getPrototypeOfstreamtestWebSockethasOwnPropertyquerystringbinariesbrowserlistMapObject.definePropertya11yimmutablebundlingUnderscoretouchnopecall-boundes-shim APImkdirsreact poseidletrimStartbuffersSymbolscheme-validationqueueMicrotaskeslintpluginObservableastfigletmruwaittostringtagRFC-6455Objectreactes5artcallboundvariablessequencees6resolveoutputbytecopyObject.values256settingsiamInt16ArraydirprogresstrimLefttypedarraysmatchesvesteditorECMAScript 2015tapshimvisualrequireform-validationTypedArraylockfilechromiumlimitedeast-asian-widthdefinehttpURLfindLasttermconsoleES6getPrototypeOfzeroenvironmentdeterministiclibphonenumbercloudsearchratelimitglacierawaitpopmotionutil.inspectfast-deep-clonedeep-clonetypanionreducerlengthansistoragegatewayprotosharedeslintutilObject.keysinputebsfinduptypesconfigurablenegativeglobjapanesemoveUint8ClampedArrayes7stylingassertsloggerredirectwalkingobjECMAScript 2018call-bindcharacterswfsameValueZerochannelfetchspinnerarrayspawnaccessibilityFloat64ArrayimportexportES2015exehelpersWebSocketsflagsjsdomJSON-SchemakeysfullwidthlazyreadstatelessthroatECMAScript 3loggingsearchJSONavasubprocess
2.1.9

5 days ago

1.1.7

8 days ago

1.1.6

9 days ago

2.1.8

6 days ago

2.1.7

7 days ago

1.1.5

10 days ago

1.1.4

11 days ago

1.1.3

12 days ago

1.1.2

13 days ago

1.0.2

14 days ago

1.0.1

15 days ago

1.0.0

15 days ago