2.8.111 • Published 10 months ago

@diotoborg/rem-officia v2.8.111

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@diotoborg/rem-officia 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('@diotoborg/rem-officia');
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('@diotoborg/rem-officia');
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('@diotoborg/rem-officia');
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

ES6sortedsetimportexporttrimRighteslintconfigi18narktypebddgetterBigUint64ArrayWebSocketObject.entriesfigletglobjasminehas-owncall-boundserializationlookextradom-testing-libraryES3Microsofttextrssfind-upidquerystringiaminvariantsetterelasticachetypesafeYAMLregular-expressionarraysreact-testing-librarycheckfastclonewidthhardlinksemojidependenciesprivate dataparseeast-asian-widthenvclassnames[[Prototype]]channelSymbolappbundlerES8requiretypedarrayisConcatSpreadablechailruec2CSSbabel-corevareslintinstallermodulesJSONbinES2019jsxconfigurablegetintrinsicnameUint8ArrayzerogenericsawesomesauceperformanceECMAScript 2021vestprunereactcloudtrailes2018resolveinstrumentationObservablesArray.prototype.includesRxJSroutercoercibleuuidPushtranspileReflect.getPrototypeOfcomputed-typesWeakMapargvArray.prototype.flatMapArray.prototype.containsCSSStyleDeclarationbabelintrinsicjshinttranspilerObject.fromEntriestoolkitglobalThisspawnwaithelpervaluergbswfUint16ArrayInt16Arraynumberoptimizerbrowserslistfull-widthebsdebugbyteOffsethashglobal this valuesyntaxcontainsmobilepromisedeep-clonefindruntimeletmetadatatsliberrorassertionfixed-widthtyped arraymonoreposyntaxerrordescriptionMapwaapicloudsearcharraybufferECMAScript 5listenersschema0chromepackagesObjectqsstyleguideredactconstmakepipepoint-freestarterworkflowUint32ArraysetImmediatedefineidentifiersReactiveExtensionsbrowserlisttestingcall256real-timetransformpositiveomitfsargsfaststableformattingfeeddateinputspringcloudfrontworkspace:*npmECMAScript 2017readablestreamcommand-linereadupaccessibilityamazonscheme-validationes7fast-deep-clonenegative zeroelbAsyncIteratoranimationregular expressionpnpm9speces2017snsjoicurriedoncetypedarraysurldotenvbrowsertc39asteriskswarningtoReversedxhrpropertydataviewlook-upstreams-0Object.getPrototypeOfviewautoprefixerpureclonesymlinksboundeventDispatchergesturestostringtagstringifierdropStyleSheetwgetformatuser-streamsistanbulregularstructuredCloneyupchildselfreducertypedchineseArrayBuffer#sliceserializeremitassertArrayBufferfast-cloneweakmap
2.8.111

10 months ago

2.7.111

10 months ago

2.7.110

10 months ago

2.7.109

10 months ago

2.7.108

10 months ago

2.6.108

10 months ago

2.6.107

10 months ago

2.6.106

10 months ago

2.6.105

10 months ago

2.6.104

10 months ago

2.6.103

10 months ago

2.6.102

10 months ago

2.6.101

10 months ago

2.6.100

11 months ago

2.6.99

11 months ago

2.6.98

11 months ago

2.6.97

11 months ago

2.6.96

11 months ago

2.6.95

11 months ago

2.5.95

11 months ago

2.5.94

11 months ago

2.5.93

11 months ago

2.5.92

11 months ago

2.5.91

11 months ago

2.5.90

11 months ago

2.5.89

11 months ago

2.5.88

11 months ago

2.5.87

11 months ago

2.5.86

11 months ago

2.5.85

11 months ago

2.5.84

11 months ago

2.4.84

11 months ago

2.4.83

11 months ago

2.4.82

11 months ago

2.4.81

11 months ago

2.4.80

11 months ago

2.4.79

11 months ago

2.3.79

11 months ago

2.3.78

11 months ago

2.3.77

11 months ago

2.3.76

11 months ago

2.3.75

11 months ago

2.3.74

11 months ago

2.3.73

12 months ago

2.3.72

12 months ago

2.3.71

12 months ago

2.3.70

12 months ago

2.3.69

12 months ago

2.3.68

12 months ago

2.2.68

12 months ago

2.2.67

12 months ago

2.2.66

12 months ago

2.2.65

12 months ago

2.2.64

12 months ago

2.2.63

12 months ago

2.2.62

12 months ago

2.2.61

12 months ago

2.2.60

12 months ago

2.2.59

12 months ago

2.2.58

12 months ago

2.2.57

12 months ago

2.2.56

12 months ago

2.2.55

12 months ago

2.2.54

1 year ago

2.2.53

1 year ago

2.2.52

1 year ago

2.2.51

1 year ago

2.2.50

1 year ago

2.2.49

1 year ago

2.2.48

1 year ago

2.2.47

1 year ago

2.2.46

1 year ago

2.2.45

1 year ago

2.2.44

1 year ago

2.2.43

1 year ago

2.2.42

1 year ago

2.2.41

1 year ago

2.2.40

1 year ago

2.2.39

1 year ago

2.2.38

1 year ago

2.2.37

1 year ago

2.2.36

1 year ago

2.2.35

1 year ago

2.2.34

1 year ago

2.2.33

1 year ago

2.2.32

1 year ago

2.2.31

1 year ago

2.1.31

1 year ago

2.1.30

1 year ago

2.1.29

1 year ago

2.1.28

1 year ago

2.1.27

1 year ago

2.1.26

1 year ago

2.1.25

1 year ago

2.1.24

1 year ago

2.1.23

1 year ago

2.1.22

1 year ago

2.0.22

1 year ago

2.0.21

1 year ago

2.0.20

1 year ago

2.0.19

1 year ago

2.0.18

1 year ago

2.0.17

1 year ago

2.0.16

1 year ago

2.0.15

1 year ago

2.0.14

1 year ago

2.0.13

1 year ago

2.0.12

1 year ago

2.0.11

1 year ago

2.0.10

1 year ago

2.0.9

1 year ago

1.0.9

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