6.10.128 • Published 11 months ago

@diotoborg/culpa-at-cumque v6.10.128

Weekly downloads
-
License
MIT
Repository
github
Last release
11 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

11 months ago

6.10.128

11 months ago

6.10.126

11 months ago

6.10.125

11 months ago

5.4.72

1 year ago

3.4.47

1 year ago

3.2.24

1 year ago

5.4.73

1 year 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

1 year ago

3.0.16

1 year ago

3.0.17

1 year ago

3.0.14

1 year ago

5.6.81

1 year 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

12 months ago

6.10.117

12 months ago

5.8.90

1 year ago

6.10.118

12 months ago

5.8.91

1 year ago

6.10.122

12 months ago

6.10.123

12 months ago

6.10.120

12 months ago

6.10.121

12 months ago

6.10.124

11 months ago

3.4.37

1 year ago

3.4.38

1 year ago

3.4.39

1 year ago

5.8.89

1 year ago

3.3.35

1 year ago

3.3.36

1 year ago

3.3.37

1 year ago

5.5.80

1 year 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

1 year ago

4.4.65

1 year ago

6.9.92

1 year ago

4.4.64

1 year ago

6.9.112

12 months ago

4.4.63

1 year ago

6.9.111

12 months ago

6.9.110

12 months ago

4.4.69

1 year ago

4.4.68

1 year ago

4.4.67

1 year ago

4.4.66

1 year ago

6.9.99

1 year ago

6.9.98

1 year ago

6.9.97

1 year ago

6.9.96

1 year ago

6.9.95

1 year ago

6.9.94

1 year ago

5.5.73

1 year ago

3.1.23

1 year ago

5.5.74

1 year ago

3.1.22

1 year ago

6.9.103

1 year ago

6.10.112

12 months ago

6.9.102

1 year ago

6.9.101

1 year ago

6.9.100

1 year ago

6.10.115

12 months ago

6.10.116

12 months ago

6.10.113

12 months ago

6.10.114

12 months ago

6.9.109

12 months ago

5.5.79

1 year ago

6.9.108

12 months ago

6.9.107

12 months ago

5.5.77

1 year ago

6.9.106

12 months ago

5.5.78

1 year ago

6.9.105

12 months ago

5.5.75

1 year ago

6.9.104

1 year ago

5.5.76

1 year ago

5.7.85

1 year ago

5.7.84

1 year ago

5.7.87

1 year ago

3.0.21

1 year ago

5.7.86

1 year ago

3.0.22

1 year ago

5.7.81

1 year ago

5.7.83

1 year ago

5.7.82

1 year 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

1 year ago

5.7.88

1 year ago

5.9.91

1 year ago

5.9.92

1 year ago

4.4.72

1 year ago

4.4.71

1 year ago

4.4.70

1 year 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