4.5.88 • Published 2 years ago

@erboladaiorg/ea-sapiente v4.5.88

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@erboladaiorg/ea-sapiente Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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

Getting started

npm install --save @erboladaiorg/ea-sapiente

Usage/Examples

var flatMap = require('@erboladaiorg/ea-sapiente');
var assert = require('assert');

var arr = [1, [2], [], 3];

var results = flatMap(arr, function (x, i) {
	assert.equal(x, arr[i]);
	return x;
});

assert.deepEqual(results, [1, 2, 3]);
var flatMap = require('@erboladaiorg/ea-sapiente');
var assert = require('assert');
/* when Array#flatMap is not present */
delete Array.prototype.flatMap;
var shimmedFlatMap = flatMap.shim();

var mapper = function (x) { return [x, 1]; };

assert.equal(shimmedFlatMap, flatMap.getPolyfill());
assert.deepEqual(arr.flatMap(mapper), flatMap(arr, mapper));
var flatMap = require('@erboladaiorg/ea-sapiente');
var assert = require('assert');
/* when Array#flatMap is present */
var shimmedIncludes = flatMap.shim();

var mapper = function (x) { return [x, 1]; };

assert.equal(shimmedIncludes, Array.prototype.flatMap);
assert.deepEqual(arr.flatMap(mapper), flatMap(arr, mapper));

Tests

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

coerciblelinkclibyteOffsetmodulesasyncfull-widthcss lesstypesafereact-testing-librarywhatwgdirectoryhardlinksstringECMAScript 7serviceFloat64ArrayvaluewindowsansitranspilerecursivehastddfunctionalassertsqsmatchAllvaluesonceprettywarningfindelectronArray.prototype.flattenarraypopmotionmacosutilredux-toolkitECMAScript 2016transpilertesterequalirqimmutablefindLaststringifieres7toolkita11yelasticacheregular expressionexitstyleguidebundlerarraybufferincludestypescriptignoreshebangkeysclassnamecodesserializermockworkflowArraynumberutil.inspectcommanderweaksetjsxfast-deep-copydeepcloneinvariantuser-streamsform-validationgetPrototypeOfBigUint64Arrayautoprefixerless.jsforEachglobalThisl10njsdomecmascriptglobFunction.prototype.namescheme-validationfast-deep-clonesigneddatacallbackserversymlinksReactiveExtensionsroutingsomecjkstarterUint32Arrayflagpreserve-symlinksintrinsiclintentriesbddpicomatchES2023isConcatSpreadableurlreact-componentacorncssexecsetImmediatenodedescriptioncompilerawesomesauceprivate datahelpersmruutilsemitminimal.gitignorejson-schemamomenttakeextendMicrosoftjoinpmlocationprocessendercommand-linefastpasswordebsprogressbusysequencedeep-clonepostcss-plugineslint-pluginhigher-orderbrowsercompile lessprefixstoragegatewaykoreanstyleswalkkeyredactinstallers3esdependenciesvalidatefantasy-landloginternalemr_.extendhashajvhttpsgestureses2015streamslicecertificatesrequestURLSearchParamsvalidatorcommandES2020prunesimpledbes-abstractspawnStreamsbindHyBierrori18npatchBigInt64Arrayconsumereadbrowserslistexit-codejQueryJSON-Schemafile systemcloudsearchroute53stringifyjson-schema-validationReflect.getPrototypeOfclientargumentpolyfillmockingcall-bindcachelistenersmovereact animationmoduleownmaketscoloridentifiersObject.keystextpoint-freestablefilestatelessflagscalloffsettoArraystatusloggertyped arrayshamutilityString.prototype.trimworkspace:*dayjssortedtypedES2021@@toStringTagstreamsString.prototype.matchAlldiffES8variablestimetacitStyleSheetcurlbyteLengthdefinereduxObservablesReactiveXasciiletjshintperformantprototypeInt32ArrayObject.fromEntriesuninstallpackageseveryfindLastIndexreusedeepcharacterredirectidlemapdatefunctionsunicode
4.5.88

2 years ago

4.5.87

2 years ago

4.5.86

2 years ago

4.5.85

2 years ago

4.5.84

2 years ago

4.5.83

2 years ago

4.5.82

2 years ago

4.5.81

2 years ago

4.5.80

2 years ago

4.5.79

2 years ago

4.5.78

2 years ago

4.5.77

2 years ago

4.5.76

2 years ago

4.5.75

2 years ago

4.4.75

2 years ago

4.4.74

2 years ago

4.4.73

2 years ago

4.3.73

2 years ago

4.3.72

2 years ago

4.3.71

2 years ago

4.3.70

2 years ago

4.3.69

2 years ago

4.3.68

2 years ago

4.3.67

2 years ago

4.3.66

2 years ago

4.3.65

2 years ago

4.3.64

2 years ago

4.3.63

2 years ago

4.3.62

2 years ago

3.3.62

2 years ago

3.3.61

2 years ago

3.3.60

2 years ago

3.3.59

2 years ago

3.3.58

2 years ago

3.3.57

2 years ago

3.3.56

2 years ago

3.3.55

2 years ago

3.3.54

2 years ago

3.3.53

2 years ago

3.3.52

2 years ago

3.3.51

2 years ago

3.3.50

2 years ago

3.3.49

2 years ago

3.3.48

2 years ago

3.3.47

2 years ago

3.3.46

2 years ago

3.3.45

2 years ago

3.3.44

2 years ago

3.3.43

2 years ago

3.3.42

2 years ago

3.2.42

2 years ago

3.2.41

2 years ago

2.2.41

2 years ago

2.2.40

2 years ago

2.2.39

2 years ago

2.2.38

2 years ago

2.2.37

2 years ago

2.2.36

2 years ago

2.2.35

2 years ago

2.2.34

2 years ago

2.2.33

2 years ago

2.2.32

2 years ago

2.2.31

2 years ago

2.2.30

2 years ago

2.2.29

2 years ago

2.2.28

2 years ago

2.2.27

2 years ago

1.2.27

2 years ago

1.2.26

2 years ago

1.2.25

2 years ago

1.2.24

2 years ago

1.2.23

2 years ago

1.2.22

2 years ago

1.2.21

2 years ago

1.2.20

2 years ago

1.1.20

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago