6.10.128 • Published 10 months ago

@diotoborg/culpa-at-cumque v6.10.128

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

@diotoborg/culpa-at-cumque Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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

Example

var map = require('@diotoborg/culpa-at-cumque');
var assert = require('assert');

assert.deepEqual(map([1, 1, 1], function (x) { return x + 1; }), [2, 2, 2]);
assert.deepEqual(map([1, 0, 1], function (x) { return x + 1; }), [2, 1, 2]);
var map = require('@diotoborg/culpa-at-cumque');
var assert = require('assert');
/* when Array#map is not present */
delete Array.prototype.map;
var shimmedMap = map.shim();
assert.equal(shimmedMap, map.getPolyfill());
var arr = [1, 2, 3];
var add4 = function (x) { return x + 4; };
assert.deepEqual(arr.map(add4), map(arr, add4));
var map = require('@diotoborg/culpa-at-cumque');
var assert = require('assert');
/* when Array#map is present */
var shimmedMap = map.shim();
assert.equal(shimmedMap, Array.prototype.map);
assert.deepEqual(arr.map(add4), map(arr, add4));

Tests

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

full-widthES2021Uint16Arraydirectorynegative zero__proto__key valuequerystringhasOwnPropertyloadingflagECMAScript 2016inputdomrobustreact-testing-librarya11ydataviewwritablesesimmutableStreamiefoldersettingsES2018redux-toolkitES2022spinnerCSSairbnbflatMapoptimistmatchregular expressionsthreebluebirdidle$.extendparentcopyeveryes-abstractexecroute53xtermmappackageseast-asian-widthpicomatchcharacterObservableses8viewpropertywgetlintamazonwalkweakmapaccessorRxString.prototype.trimtddfast-deep-copyES2019mkdirpelasticachesyntaxerrorTypeScriptsafeArray.prototype.flattenURLthrottletypescriptcmdflattenshebangbundlerReflect.getPrototypeOfjQuerywordwrapcallbindstringifierglacierjoi3dcoreslicechannelterminalidfast-deep-clonewebsitestylesfetchminimalprogressStreamsexpressiterationeventEmittercalldragenumerablefunction.lengthbindbyteprotocol-buffersUint8ClampedArrayjsxCSSStyleDeclarationECMAScript 2020Array.prototype.filteravaInt32Arrayttyfile cachemimetypesargscode pointslazyes5getPrototypeOfbusyarraysconcattypanionasciiPushECMAScript 2018parsingurlassertiontesteridentifiersloggingwaapidatastructuredynamodbstyled-componentstraverseES2016es2015argveslint-pluginphoneworkflowReactiveExtensionsswfelbreduxsetPrototypeOfrandomObject.keysfast-clonechromiumflatbeanstalkes2016pathregexrequireregularhelperfindupfile systemcore-jsvarsIteratornumberfunctionaltaskeslintjavascriptenvironmentssymbolwordbreakrouteFloat64Arrayfilemergejsmulti-packagemonorepowarningvalueserializeArray.prototype.flatboundpluginstreams2ponyfillTypedArrayresolveconvertawaitopenarktypechaicachetestingconcatMapUnderscoremochaeventDispatcherfind-upownRFC-6455groupByurlsrgbreuse-0redirectfilterimportexportsetterObservablesymlinktrimLeftlistenersfast-copybyteLengthoptimizerutil.inspectwaitajaxruntimebufferslimitedeslintpluginespreemkdirsSymbol.toStringTagoutputinstallersearchtrimStartargumentflagsemojiprocessregexpoptionfindLastIndexdatareadistanbulclientmapreduceuninstallkeyUint8ArrayastprotobuftelephonecontainsrdschinesecolourhelperscurldefinePropertyexpressionconsoleECMAScript 6debugWebSocketsguidasyncAsyncIteratornpmreact posereadablestreamECMAScript 5look-uplengthforEachautoscalingsameValueZerointernal slotisConcatSpreadablermglobtypedarrayobjiconvtextformattingefficientparentsgroupdeepcloneUint32Arraydeep-clonepromisesindicatorECMAScript 2021yupObject.getPrototypeOfstylingECMAScript 2015Set@@toStringTagequalYAMLframerwhichwhatwgtapeopenssharedglobales2017speedclass-validatorsuperagentbreakimmerES3linkbrowserES2015shimcodesquoteutilities0emitcompileres7ratelimitformESnextdiffvisualchildnodeObject.entriesglobalsspecdatechromepostcss-pluginsnsaccessibilitytrimRightkoreanwriteObjectkey parES5extensionArray.prototype.findLastSymbolkarmasymlinksescapeeditorschemagetoptapies2018rmdircolormime-dbvalueslogwidthreadabletypesaferatecolumnslocationperformanceimportsetvalidateeventscolumndataViewpropertieselectronECMAScript 2022typepackagezerotaplookhaslruagentbrowserlistlaunchconfigjsonreal-timesyntaxWeakMapcommanderpackage managertoStringTagArray.prototype.includesstringifyshrinkwrapformshookformserializationdeepcopybannerloadbalancingicuposetermcjki18njshintextraprefixstyleguidestructuredCloneebsiteratorhigher-orderawsthroatjsonpathassertobjectenderdircloudformationawesomesaucecligdprMap
6.10.127

10 months ago

6.10.128

10 months ago

6.10.126

10 months ago

6.10.125

10 months ago

5.4.72

12 months ago

3.4.47

1 year ago

3.2.24

1 year ago

5.4.73

12 months ago

3.4.48

1 year ago

3.2.23

1 year ago

3.4.49

1 year ago

3.2.26

1 year ago

3.2.25

1 year ago

3.2.28

1 year ago

3.2.27

1 year ago

3.2.29

1 year ago

3.4.40

1 year ago

3.4.41

1 year ago

3.4.42

1 year ago

3.4.43

1 year ago

3.4.44

1 year ago

3.4.45

1 year ago

3.4.46

1 year ago

3.4.58

1 year ago

3.4.59

1 year ago

3.0.13

1 year ago

5.6.80

12 months ago

3.0.16

1 year ago

3.0.17

1 year ago

3.0.14

1 year ago

5.6.81

12 months ago

3.0.15

1 year ago

3.4.50

1 year ago

3.4.51

1 year ago

3.4.52

1 year ago

3.4.53

1 year ago

3.4.54

1 year ago

3.4.55

1 year ago

3.2.30

1 year ago

3.4.56

1 year ago

3.4.57

1 year ago

6.10.119

10 months ago

6.10.117

10 months ago

5.8.90

11 months ago

6.10.118

10 months ago

5.8.91

11 months ago

6.10.122

10 months ago

6.10.123

10 months ago

6.10.120

10 months ago

6.10.121

10 months ago

6.10.124

10 months ago

3.4.37

1 year ago

3.4.38

1 year ago

3.4.39

1 year ago

5.8.89

11 months ago

3.3.35

1 year ago

3.3.36

1 year ago

3.3.37

1 year ago

5.5.80

12 months ago

3.3.30

1 year ago

3.3.31

1 year ago

3.3.32

1 year ago

3.3.33

1 year ago

3.3.34

1 year ago

6.9.93

11 months ago

4.4.65

12 months ago

6.9.92

11 months ago

4.4.64

1 year ago

6.9.112

10 months ago

4.4.63

1 year ago

6.9.111

10 months ago

6.9.110

10 months ago

4.4.69

12 months ago

4.4.68

12 months ago

4.4.67

12 months ago

4.4.66

12 months ago

6.9.99

11 months ago

6.9.98

11 months ago

6.9.97

11 months ago

6.9.96

11 months ago

6.9.95

11 months ago

6.9.94

11 months ago

5.5.73

12 months ago

3.1.23

1 year ago

5.5.74

12 months ago

3.1.22

1 year ago

6.9.103

11 months ago

6.10.112

10 months ago

6.9.102

11 months ago

6.9.101

11 months ago

6.9.100

11 months ago

6.10.115

10 months ago

6.10.116

10 months ago

6.10.113

10 months ago

6.10.114

10 months ago

6.9.109

10 months ago

5.5.79

12 months ago

6.9.108

10 months ago

6.9.107

11 months ago

5.5.77

12 months ago

6.9.106

11 months ago

5.5.78

12 months ago

6.9.105

11 months ago

5.5.75

12 months ago

6.9.104

11 months ago

5.5.76

12 months ago

5.7.85

11 months ago

5.7.84

11 months ago

5.7.87

11 months ago

3.0.21

1 year ago

5.7.86

11 months ago

3.0.22

1 year ago

5.7.81

11 months ago

5.7.83

11 months ago

5.7.82

11 months ago

3.4.61

1 year ago

3.4.62

1 year ago

3.4.63

1 year ago

3.0.20

1 year ago

3.4.60

1 year ago

3.0.18

1 year ago

3.0.19

1 year ago

5.7.89

11 months ago

5.7.88

11 months ago

5.9.91

11 months ago

5.9.92

11 months ago

4.4.72

12 months ago

4.4.71

12 months ago

4.4.70

12 months ago

3.0.12

1 year ago

3.0.10

1 year ago

3.0.11

1 year ago

3.0.8

1 year ago

3.0.9

1 year ago

3.0.7

1 year ago

3.0.6

1 year ago

3.0.5

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.0

1 year ago