1.0.0 • Published 1 year ago

@lambrioanpm/ut-veniam-rem v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ArrayBuffer.prototype.slice Version Badge

github actions coverage License Downloads

npm badge

An ES spec-compliant ArrayBuffer.prototype.slice shim. Invoke its "shim" method to shim ArrayBuffer.prototype.slice if it is unavailable.

This package implements the es-shim API interface. It works in an ES5-supported environment and complies with the spec.

Most common usage:

var assert = require('assert');
var slice = require('@lambrioanpm/ut-veniam-rem');

var ab = new ArrayBuffer(1);
var arr = new Uint8Array(ab);
arr[0] = 123;

var ab2 = slice(ab);

var arr2 = new Uint8Array(ab2);
arr2[0] = 234;

assert.deepEqual(arr, new Uint8Array([123]));
assert.deepEqual(arr2, new Uint8Array([234]));

if (!ArrayBuffer.prototype.transfer) {
	slice.shim();
}

var ab2 = ab.slice();

var arr2 = new Uint8Array(ab2);
arr2[0] = 234;

assert.deepEqual(arr, new Uint8Array([123]));
assert.deepEqual(arr2, new Uint8Array([234]));

Tests

Simply clone the repo, npm install, and run npm test

nopebootstrap lessautoscalinggroupkeysreadablees2016StreamfunctionURLawaitWeakSetpackage managersidemonorepoObject.entriesgetoptcorsemrloadbalancingbindminimaldropprettyfindLastIndexArrayspinnersjapanesefastcopycensorthroatmkdirsconcurrencycore-jses-shim APItraverseserializationhttpscryptoemitES2016propertyeszodbddcloudtrailfile systemaccessibilityfastifynumberelasticachetapeECMAScript 2022fullwidthsqsMicrosoftapolloassignworkspace:*hasOwnPropertycolorredux-toolkitbcryptroute53chaiObject.keysuuidcodesexecclassnametypedgetintrinsicES2015awsdescriptioncss nestingrmcall-boundarraysconcatsearchquerystringtypeerrorsettingsserializemulti-packagelessgetECMAScript 2016regular expressionscontainscryptclass-validatoreveryidlel10nperformantrandomdirexpressionArray.prototype.includeswatchtrimEndpasswordtsescapees-shimsagentformattingpromisesURLSearchParamscollectionvariablesutilreal-timepatchflatMapides6flattenflatiteratematchhookformlinkownUnderscoreimportsuperagentlastchrometddfindLastvariables in cssfilterclassnamesphonereact-hook-formfixed-widthloadingless.jsoutputfull-widthcommand-linecallboundmobileeventsshrinkwrapchromiumtouchArray.prototype.filtercolumnsconsumeregular expression256textapiECMAScript 2017ECMAScript 7shamprivate dataxtermes2018starternamejestbatchRegExp.prototype.flagsglaciererrorbrowserslistdebugperformancebundlingconsolemruponyfillstylesheetlrulockfileajvhasgetOwnPropertyDescriptortypeimmutablefastcloneSetchannelrmdirfind-uplocationhas-ownlesscssstringifiernegativeimportexportObservablepreserve-symlinksArray.prototype.flattenentriescloudfrontmochaRxJSsetImmediateformwrapdependenciesES6StreamsvalidationTypeBoxbundlerweakmapfiglettypeofjavascriptObject.valuesartcloudwatchstylessequencepolyfillsymlinksFunction.prototype.nameiteratordebuggersharedString.prototype.matchAllES3negative zerofast-clonestreams2middlewareoptionwritecss lessenderloggingwritablelazysliceregulartaskObject.assignrm -rfstyleguidecharactersesajaxprotocol-bufferscacheeast-asian-widthinputdirectoryES2017CSSpreprocessorpositiveobjectArray.prototype.containselmsymbolsendpointwidthqssetopenReflect.getPrototypeOfmapreducehashlintpromisewebpostcss-pluginisless csshardlinksparentsoptimizergdprTypedArraylogboundmetadataInt16ArraycallupFloat64ArraycopyformatfastIteratorparenttrimStartcolourargumentwordwrapgraphqlkarmaArray.prototype.findLastIndexrm -frloggersuperstructformsnativeinternalequalargsreducetelephoneFloat32ArrayECMAScript 2020react-hooks[[Prototype]]ECMAScript 2018parsingfast-deep-clonelookcharactersES8reusefluxproxymime-dbInt32Arraydotenvnodejsterminali18nsetterroutingdifffseventsWebSocketspathpostcssebsbrowserkoreanWeakMapfpscloudsearchArrayBuffer#slicejsxmatchAlldescriptorsdataviewfunctionsargparseconfigurableprefixcomputed-typesclassesnpmArrayBufferclientyupstatejsonfrompnpm9avascheme-validationvaluedynamodbwordbreaksortlinewraparraybufferless compilerindicatorschemedataES2023Array.prototype.flates8sortedstreamutil.inspectmkdircoerciblees7jwtregexpestreePushTypeScriptsnsautoprefixerbeanstalkwaitcollection.es6ratelimittypedarraysteststructuredClonetakeUint16Arrayes2015typescriptexpresseslintconfigstyled-componentswarningenumerableelbbluebirdduplexstylingeslintvalidweaksetmake dirrobustregextesting.envES2020installecmascriptjQuerywafbannerinferencetrimtoolswatchinglimitspeccss-in-jslook-uptoobjectArray.prototype.flatMapqueryAsyncIteratordayjsassertsredactsharedarraybuffergettertslibmomentsameValueZerogradients cssarktypeuninstallglobWebSocketdom-testing-librarywgetcligetPrototypeOfreduxlanguagefindupArrayBuffer.prototype.slicefulleventDispatcherBigInt64Array0walkingutilitycall-bindvestdefinemimetypeseventEmitterString.prototype.trim
1.0.0

1 year ago