2.11.68 • Published 1 year ago

@hishprorg/iste-cupiditate-mollitia v2.11.68

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

@hishprorg/iste-cupiditate-mollitia 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('@hishprorg/iste-cupiditate-mollitia');
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('@hishprorg/iste-cupiditate-mollitia');
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('@hishprorg/iste-cupiditate-mollitia');
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

fnmatchpreserve-symlinksfunction.lengthreact-hook-formfastcopymanager256definePropertycachebddpropertieselectronbrowserlistbufferdependenciesxhrPushfunctionchaiansiutil.inspectECMAScript 2020ES2015make dirstoragegatewayinferenceES2022ES2018workflowconsoleaccessoriterationformsdomreplayiteratorcolorsmkdirppersistenthandlersfetches-abstractoptionaccessibilityarraybufferhookformArray.prototype.findLastIndexECMAScript 2016Uint32ArraycloudfronttoolkitparsingmovesameValueZeromergeES2020unicodetranspilertypesafeshamec26to5popmotioncss variabletrimStartcore-jshotjsonschemareact poseECMAScript 2019corefigletBigUint64ArraywafiamflagES2017pluginjsxa11yRegExp.prototype.flagsfantasy-landmonorepoprotocol-buffersIteratortypedes7readbeanstalkObject.definePropertyyupObject.entriescss nestinghelpertoReversedefficientpostcss-pluginisConcatSpreadableObject.assigngetString.prototype.trimemrequalitytoobjectlockfilees2015deepcopynodejses2018statusspawnignoreoperating-systemacornreal-timestatebcryptpostcssphonepnpm9clientmapreduceArray.prototype.flattencall-bindtc39springObject.valuesthreetypeerrors3zodfullwidthReactiveExtensionsclicreatebootstrap lessvaluesrgbTypeScriptclass-validatorObject.isStyleSheetastargsvarspropparserUint8ArrayES7authuuidpathvariables in cssArray.prototype.findLastobjapollonumberstreamsramdaajaxbabelpackage.jsonutilitieslivemodulesarktypetrimgroupECMAScript 2015arrayspromisecompiler[[Prototype]]windows$.extendAsyncIteratoromitES5functionalponyfillArrayBuffer.prototype.slicesignalInt16Arrayhardlinkstransporthigher-orderanimationiteratesafefluxwaapierror-handlingserializeqsasciiObject.getPrototypeOfbytetestObject.keysRxzeroautoprefixerserializationWeakSetrdsCSSpureschemeebssubprocesspyyamlkinesiszxschemaescapecurlselfWebSocketssortedsetImmediatechromeinvariantlocalnpmcodescommandercallboundInt32Arrayrangeerroreslintconfigchildsymbolsfast-deep-cloneObjectglobal objectreadablestreamfastifytoArrayformflatMapeslint-pluginStreamswftermchromiumsettingsuninstalljestestreeconstspinnerscensorprettysharedarraybufferwhichdataViewYAMLsimpledbl10nBigInt64Arraywgeteslintfull-widthtypedarrayassertless csssigtermshelldataviewexitfullkoreanecmascriptremovespinnercomparequotestreambundlerTypedArrayawsstatelessmrubootstrap cssnodeletfpdeleteexecutehttpsoffsetpredictabletypanionfast-deep-copydefineflathasOwnPropertyidentifiersmacoscolumnnameirqbannerqueryextendcontainsperformantconfigurableminimaltddcollectioncallSymboloptimizerlastECMAScript 5callbackarrayeast-asian-widthforEachjson-schema-validatorgdprprunegenericsvarenvironmentinstallArray.prototype.flatMapviewposeshebanges5redux-toolkitparsefilejsdombyteLengthPromiseECMAScript 2022ECMAScript 2023loggerpasswordregular-expressiondatastructuretostringtagisbyteOffsettimeloggingcoercibleString.prototype.matchAllcircularUint8ClampedArrayglobgesturesformatharmonyendermodulejoilrunegative zeroCSSStyleDeclarationtypeofairbnbURLSearchParamsvariablesbindes8errorES3cryptojshintbuffersassertionsortUint16Arrayeffect-tstoolsenumerablestyled-componentsmetadatasomeexecfileInt8Array.gitignoresqslesscssenvcharactertshookslanguagesetterurlbinariesdataregexpextradateRegExp#flagsdrag_.extendasyncapiexpresstypescriptrapidcompile lesstyped arraynested cssStreamssuperagentreducerArray.prototype.containsregular expressiongradients css3protobufimmutablefixed-widthnegativegraphqlhelpersvpcgradients cssterminalsyntaxerrordiffcolorsyntaxlogFloat32Arraydirectoryconsumeroutesnskeysdeepinputreact animationrandomasterisks
2.11.68

1 year ago

2.11.67

1 year ago

2.10.67

1 year ago

2.10.66

1 year ago

2.10.65

1 year ago

2.10.64

1 year ago

2.10.63

1 year ago

2.10.62

1 year ago

2.10.61

1 year ago

2.10.60

1 year ago

2.9.60

1 year ago

2.9.59

1 year ago

2.9.58

1 year ago

2.9.57

1 year ago

2.8.57

1 year ago

2.8.56

1 year ago

2.8.55

1 year ago

2.8.54

1 year ago

2.8.53

1 year ago

2.7.53

1 year ago

2.7.52

1 year ago

1.7.52

1 year ago

1.7.51

1 year ago

1.7.50

1 year ago

1.7.49

1 year ago

1.7.48

1 year ago

1.7.47

1 year ago

1.7.46

1 year ago

1.7.45

1 year ago

1.6.45

1 year ago

1.6.44

1 year ago

1.6.43

1 year ago

1.6.42

1 year ago

1.5.42

1 year ago

1.5.41

1 year ago

1.5.40

1 year ago

1.5.39

1 year ago

1.4.39

1 year ago

1.4.38

1 year ago

1.4.37

1 year ago

1.4.36

1 year ago

1.4.35

1 year ago

1.4.34

1 year ago

1.4.33

1 year ago

1.4.32

1 year ago

1.4.31

1 year ago

1.4.30

1 year ago

1.4.29

1 year ago

1.4.28

1 year ago

1.4.27

1 year ago

1.4.26

1 year ago

1.4.25

1 year ago

1.4.24

1 year ago

1.4.23

1 year ago

1.4.22

1 year ago

1.4.21

1 year ago

1.3.21

1 year ago

1.3.20

1 year ago

1.3.19

1 year ago

1.3.18

1 year ago

1.3.17

1 year ago

1.2.17

1 year ago

1.2.16

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

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