1.0.4 • Published 1 year ago

@juigorg/accusantium-ipsum v1.0.4

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

@juigorg/accusantium-ipsum Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES spec-compliant Array.prototype.splice shim/polyfill/replacement that works as far down as ES3.

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

Because Array.prototype.splice depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.

Engines where this is needed

Note: this list is not exhaustive.

  • IE 8 and below, and pre-ES6 engines: deleteCount isn't defaulted to length - start until ES6
  • Safari 5.0: sometimes it returns undefined
  • Safari 7/8: sparse arrays of size 1e5 or greater break
  • Opera 12.15: breaks on small sparse arrays

Example

var splice = require('@juigorg/accusantium-ipsum');
var assert = require('assert');

var a = [1, 1, 1];
assert.deepEqual(splice(a, 1, 2), [1, 1]);
assert.deepEqual(a, [1]);
var splice = require('@juigorg/accusantium-ipsum');
var assert = require('assert');
/* when Array#splice is not present */
delete Array.prototype.splice;
var shimmed = splice.shim();
assert.equal(shimmed, splice.getPolyfill());
assert.equal(shimmed, Array.prototype.splice);
assert.deepEqual([1, 2, 3].splice(1, 2, 3), splice([1, 2, 3], 1, 2, 3));
var splice = require('@juigorg/accusantium-ipsum');
var assert = require('assert');
/* when Array#splice is present */
var shimmed = splice.shim();
assert.equal(shimmed, Array.prototype.splice);
assert.deepEqual([1, 2, 3].splice(1, 2, 3), splice([1, 2, 3], 1, 2, 3));

Tests

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

fast-deep-clonelocalemojichromeprotodeep-copyECMAScript 7Uint32ArrayES2016ES5WebSockettoolsdependenciespopmotionlogES2023binarymobileglobaldomInt32Arrayimmerrfc4122CSSeventDispatcherestreeemrswfimportexportArray.prototype.flattenMaploggerfindupstyleguidesearchlockfilebeanstalkmapreducegetPrototypeOfUnderscorejestes-shim APItyped arrayhookscloudwatchdefineprivate dataassertsRxJSFloat32ArrayexpressrmlocationnpmregexpawesomesauceStreamsanimationoncees8CSSStyleDeclarationfigletmanagerflagassertdynamodbECMAScript 2019schemaargsInt16Arrayes7accessibilityprotobufmulti-packagehigher-ordervariablesjoiidentifiersconstes2017configurableRFC-6455cloudtrailURLtypeerrorES8optionstringifyapollotoobjecttscssoptimizerinstrumentationfixed-widthESnextnodeworkflowString.prototype.trimmonorepohttpArrayBufferfunctionstimeECMAScript 2016censortypedarrayintrinsicelasticachelook-uppathcolumnsunicodecss-in-jspureRegExp#flagsrapiddayjsio-tskey valuecompareflatMaplookloggingcollection.es6jsdomdragmatchfastclonetexteffect-tsObject.assigntakesetPrototypeOfwhichomiterror[[Prototype]]busyiamcallbacktestappbundlerform-validationstructuredCloneBigInt64ArraytaperequestsetImmediatechineseescapeObjectcoerciblefromvarmake dirconcatMapcodesObservablessharedtypedarraysconsumepinoexecutees2016typeautoscalingelbargvtrimtransportkinesisdependency managerbyteprivatestylesreactsymbolstoragegatewayprogressnativereal-timePromiseatombyteLengthInt8ArrayenvironmentinferenceagentequalitybrowserslistECMAScript 2018glacieraccessorbundlingbyteOffsetes5varscomputed-typeshookformmkdirpmoduleswidthframerextendtrimEndshellES3threequeuedeepformattingsliceguidhardlinksdirectoryreact-hook-formjsondom-testing-libraryfpslengthjapanesearraysrestredux-toolkitstablefunction.lengthIteratorreuseWeakMapTypedArrayreduxObject.valuestesterrandompropserializationArray.prototype.findLastkeyyamlbinariescircularvpcArray.prototype.containsfull-widthsuperstructprocesscolourhelperloadbalancingprototypei18nmovehasUint8Arrayyupformfullfetchebsendpointprettyapiautoprefixer0deepcopysnsindicatorwalkingparentsuuidimmutablecolorsassertionstyled-componentstranspilesyntaxkey parsymlinksflattensqsrm -frinstallerrsshasOwnPropertybufferresolveTypeScriptlistenersutilservicejson cachetermarktypecjkmomentpackagessortedredirectES2015writeimportremoveES2019iteratorECMAScript 5eventEmittervalidoptimistcloudformationproxyinspectStreamnumberdescriptorpolyfillfeedhtmlrouterJSON-Schemafoldermaplintmanipulationcommandesroutingfast-copyreact-hooksspeedminimalstylepyyamlinternalreversednegativespinnersdescriptorsclassesfnmatchsameValueZeroES2022Reflect.getPrototypeOfworkercallbindfastifyieruntimehttpsclassnamesmochasyntaxerroroutputfile cacheECMAScript 2020moduleArray.prototype.includesgraphqlcollectionflagskeysarrayregular expressionregular-expressionwhatwgecmascriptnpmignorecloudsearchrestfulposemerge-0dataViewwaapilibphonenumbercallboundcreatequerystreamstypanioncompilernameharmony$.extendkoreanHyBigetterbrowserlistpipeBigUint64ArrayperformantStyleSheetvestrangeerrorxhrgesturesequalreworklastparsefast-clonepackage managerRxES2018valueinvariantsomesinatraspringttyrequirenegative zerotransformECMAScript 2015typescriptArray.prototype.filteridstreamscheme-validationcall-bindpatchchildtoStringTagconsolees2015phonepreprocessorreadablestreamroute53nopePushsimple cacheoffsetdircopymocksafetypescommand-lineformshashjshintUint8ClampedArraycolorl10nUint16Arrayglobalshas-ownconcatvalidationTypeBoxgetOwnPropertyDescriptorcontainsserializerfilefunctionalutilitiesdebuggerFunction.prototype.nameentriespackage.jsonquoteexecfilereducees2018bddbrowser__proto__checkobjcharacters3disConcatSpreadables3javascriptmockingtslibcolumnajvjsdiff6to5fullwidthschemerdsmetadatatoolkitenumerableignoreup256handlerbindstarterkarmaSymbol.toStringTagrobustECMAScript 6mkdirsserializefindLasttostringtagarraybufferuninstallpromisefile systemshamwebArray.prototype.flatvaluesjasmineparsertrimRightreact-testing-librarywafcloneforEachcode pointselectronhasOwnECMAScript 2021routeshrinkwrapfast-deep-copycorechanneldateforkqsfind-upistanbulownYAMLflaturlansienvironmentstestingglobwritabletypedES2021settercallairbnbquerystringlanguageObject.entriesbannerArrayBuffer#sliceperformancereact poseJSONexecasyncuser-streamsavaweaksetsetpropertiesbabeltrimStartwalkprotocol-buffers@@toStringTagsubprocessasciiES2017postcss-pluginlinkparentsettingssuperagentstringifiermatchestraverseprefixeslintconfiggenericscloudfrontredactECMAScript 2017boundframeworkArrayBuffer.prototype.slicerulesWeakSetutilityiteratetoSortedtapECMAScript 2022deepcloneextraspawnlru_.extendrgbeventsReactiveXMicrosoftshimenderxmlises-abstractchromiumchaifputilsObject.keysserverwgetmaketypeofassigncommanderfindLastIndexinfunctionsortidleregular expressionsobjectawssimpledbefficientURLSearchParamspluginrm -rfdiffAsyncIteratorweakmaptacitclientformatrecursivefastclassnamemkdirtranspilerpoint-freetc39envreducerdatagroupBypushObject.definePropertyArray.prototype.flatMaptelephoneES2020visualpicomatchec2toReversedmrugetbabel-corehelpersESprunedebugObject.fromEntriesargumenteslintpluginstylingcurriedback-endincludesshebangloadingponyfilleslint-pluginespreesource maptrimLefttoucheast-asian-widthES6fantasy-landcurlemitgroupWebSocketsgetoptzodfastcopydropreversextermfilternamesSymbol.envES7front-endtypesafestringbinsessharedarraybuffermatchAllcall-bound
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