1.1.9 • Published 1 year ago

@juigorg/voluptatibus-corrupti v1.1.9

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

@juigorg/voluptatibus-corrupti Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES5 spec-compliant Array.prototype.reduce 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.reduce depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.

Example

var reduce = require('@juigorg/voluptatibus-corrupti');
var assert = require('assert');

assert.equal(reduce([1, 2, 3], function (prev, x) { return prev + x; }), 6);
assert.equal(reduce([1, 2, 3], function (prev, x) { return prev + x; }, 1), 7);
var reduce = require('@juigorg/voluptatibus-corrupti');
var assert = require('assert');
/* when Array#reduce is not present */
delete Array.prototype.reduce;
var shimmed = reduce.shim();
assert.equal(shimmed, reduce.getPolyfill());
var arr = [1, 2, 3];
var sum = function (a, b) { return a + b; };
assert.equal(arr.reduce(sum), reduce(arr, sum));
assert.equal(arr.reduce(sum), 6);
assert.equal(arr.reduce(sum, 1), 7);
var reduce = require('@juigorg/voluptatibus-corrupti');
var assert = require('assert');
/* when Array#reduce is present */
var shimmed = reduce.shim();
assert.equal(shimmed, Array.prototype.reduce);
assert.equal(arr.reduce(sum), reduce(arr, sum));

Tests

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

Array.prototype.flattimeuninstallistslibclassnamesArray.prototype.containsPushairbnbtoolsmatchmanipulationexeclibphonenumberstablemetadataloadbalancingMicrosoftjsxTypeBoxfantasy-landunicodeeveryvarswgettrimEndwalk@@toStringTagdataviewCSSStyleDeclarationimportexporttoobjecttoArrayboundIteratorpopmotionemitflatwhichkeyssetImmediatees-shim APItransformObject.getPrototypeOfclone3danimationESnexteslintconfigbrowserslistutil.inspectargvreducerelasticachediffglacierreact-hook-formArray.prototype.flattendragFunction.prototype.namescheme-validationES3slicemodulesgroupbyteLengthsetPrototypeOfquerystringshebangfp.envspeedyupcallboundrequireprivateserializestoragegatewayhtmlframeworkmonoreposerializationrestrulesimmerObject.assignfind-uplook-upcopycensorrestfullintrm -frsimpledbtransporttrimLeftqueryflagspnpm9Symbolpostcss-plugintypeofassertownqsES2016npmecmascriptsqstc39streamemrignoredescriptorindicatorlinkworkercjkespreestyleinternalclassestapes2017getOwnPropertyDescriptorajvpackagebyteassertscircular.gitignoreeffect-tsfunctions_.extendhasOwnPropertymruES2019Symbol.toStringTagcore-jseslintsettingsfindupoutputcachecall-bindargumentdefinePropertyxmlES2020installES2022polyfilltrimfetchbufferRegExp.prototype.flagsgetterreadableuuidtranspilerECMAScript 2022es2018syntaxerrorpushhas-owntypeString.prototype.matchAlljsdiffstringkarmashimURLjsonschemareal-timeinspectnodejsformstyleguideclitextnodefast-deep-copydebuggerescapevalidatestreamsextendArray.prototype.findLastIndexremovebabel-corepackage.jsonregularfastclonestringifierfnmatchserializerECMAScript 2015reuse256coverageredactrmhaspropprotocol-bufferszerotostringtagnamestypesafetestingtsjson-schema-validatorparsertypanionwafiteratedom-testing-librarys3toReversedparentfindLasthelpersintrinsicWebSocketiamwarningaccessibilityECMAScript 2021importcallbindjson-schema-validationrangeerrorinputpromiseatomes5__proto__prefixiteratorroutertypedworkspace:*keyroute53queueMicrotaskfull-widthchainpmignorenumberbddreadablestreamdatababelwidthinnamemkdirpassertionpatchfast-copyReflect.getPrototypeOfspawninferenceweaksettrimRightentriesphonedeterministicdotenvHyBifastifyreduxvalidationObject.fromEntriesglobalThisfastECMAScript 7environmentdynamodbdescriptionwhatwgreactawesomesauceWebSocketsloadingartECMAScript 2018matchAlles7PromisecolumnsdatepackagestakeconsolemakeECMAScript 2019locationsideansiacorncolumnECMAScript 2023viewlistenersguidmovecontainsArrayBufferredux-toolkitcloudsearchcollectiondayjsES2021pathobjectl10nArrayBuffer.prototype.slicecompareWeakMapstructuredClone6to5traversetoSortedESwritableparentsform-validationdropec2functionalautoprefixerArrayBuffer#slicedeep-clonetypedarrayscallformsObject.valuesMapfinddependency managerrm -rfamazontranspiledebugcoerciblenegative zeroperformanceestreesuperstructuser-streamscryptofoldershellchromiumString.prototype.trimtouchStyleSheetStreamObject.isequalityforEachutilsReactiveExtensionshardlinksjson-schemaclass-validatorSystem.globalformattingArray.prototype.flatMapES6mkdircreatemapoptionautoscalingebshttps-0arrayssortedreverselastfile systemes-shimsECMAScript 3Int8ArraythreeBigInt64Arrayvariablesclientmulti-packageformatponyfillpropertieszxes6es2015sometypedarraycollection.es6typescriptisConcatSpreadablevalidtermminimalUint8ClampedArraydefineprocessasciixtermECMAScript 6performantprivate datagdprstylingavafunction.lengthrgbECMAScriptUint32ArraytapeexecutesuperagentconsumehasOwnoffsetvaluesapollogitignorepositiveapiObject.keysECMAScript 2016javascriptconfigurableenumerablebindconcatstyled-componentsES2018source map0prototypegraphqlefficientidentifiersfunctionRxJScharactersreworkstringifySetkinesisObject.entriescomputed-typesbeanstalkkoreantoStringTageslint-plugineventEmitterinstrumentationprotobufendpointbrowserlistobjgesturesObservablevarasynctoolkitpoint-freecommand-linelockfileprettypipeJSON-SchemaappUnderscoredeletefindLastIndexTypeScriptcall-boundpropertyArray.prototype.includesBigUint64ArrayregexECMAScript 5setlocalspinnersymbolhasha11ydeepclonedataViewYAMLcloudtrailES2015runtimecurlpureterminalselfastfulltestframerrequestbannercompilersetterconcatMapcallback[[Prototype]]directorynopewebflaggetintrinsicchildprotorssenvironmentsjsonreact animationpyyamlES5chromeaccessorupimmutablewaitschemalrubinarylanguagespringeventscloudfrontmake dirJSONresolveesistanbulObservablesdomtyped arrayequalflattenagentcharacterutilchineseES7getoptpreprocessorcode pointsmapreducefigletcssconstreversedstylescss-in-jsfromWeakSetjsarraybufferexpressfast-deep-clonetelephoneexpressiontacitjoischemerecursivevpcinstallerfixed-widthpostcssRFC-6455robustbusyquotees2016managerlookhookscolourregular-expressionnativecheckdescriptorseventDispatcherfastcopymodulecoreemojiarraynegativereact posebyteOffsetfast-cloneglobal objectmkdirsi18nStreamssearchfsyamlweakmapES8arktypefilterroutingredirectpluginFloat32ArrayregexpFloat64Arrayeast-asian-widthenderpinosymlinksUint16Array$.extendcurriedhookformprogressrandommomentcommanderjasminefeedextrazodexecfileES2017typeerrorramdaTypedArrayutilitiesloggingrapidgetPrototypeOfshrinkwrapstarterieInt32ArrayxhrposeidglobalsrouteRegExp#flagssyntaxidleArray.prototype.findLastReactiveXassignharmonyurlhelperelectronmergeproxyURLSearchParamsoncereadeslintpluginjshintprunebinariessessharedenvpackage managerpicomatchrdsjsdomincludesmobilespinnerssymbolsoptimizercolorregular expressionArraytrimStarttesteres-abstractio-tsUint8ArrayreduceconfigbundlerslottddclassnamermdirparsettysharedarraybufferbrowserforkInt16Arraydeepcopysnsinternal slotfile
1.1.9

1 year ago

1.1.8

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