6.7.109 • Published 10 months ago

@patrtorg/vitae-sint v6.7.109

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

@patrtorg/vitae-sint 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 @patrtorg/vitae-sint

Usage/Examples

var flatMap = require('@patrtorg/vitae-sint');
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('@patrtorg/vitae-sint');
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('@patrtorg/vitae-sint');
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

codesES2023flatMapbyteOffsetdataViewsetsettingsES2019accessibilitymake dirclientttyfull-widthpinotypedarrayArray.prototype.findLastcontainsshellreworksharedarraybufferguidbincallexecfile$.extendlintharmonyclassesmomentObjectgdprextramkdirsprivate datastoragegatewayentriesobjjoicjkstreamspositiveidtrimdirArray.prototype.containsgestureswafECMAScript 2019typeerrorfsfpsObject.assigntapewalkingUint32ArrayoffsetES5typesfastifytimeeast-asian-widthpnpm9YAMLtoobjectstarterautoscalinggitignoreramdanegativeformtrimEndTypedArraychaiwaitBigUint64ArraytraverseRegExp.prototype.flagsfunctionalredux-toolkitdynamodbcode pointsatomjapaneseenumerablegetteres6pathcommand-linees2017eslintcopydiffterminalarrayslastregular-expressionlruReflect.getPrototypeOftypedarraysidentifiersrmconsoledeterministic__proto__dataviewmulti-packageObject.getPrototypeOfdayjsES2020getoptcoerciblebeanstalkreducetapchromiumuninstallsymlinkstoolssuperagentforEachRxJSlocalmanageroptimistloadingpackagesymbolutilagentpushindicatorcompareUint8Arrayprototypeglacierlook-uptacitwebconstequalStyleSheet_.extendregular expressionsStreamzodmochas3cloneArray.prototype.includeswritefind-upfigletECMAScript 2016ES2018serviceieajvkeycoveragegroupByemrroutertostringtagserverECMAScript 7ECMAScript 6immerio-tstyped arrayimportexporttrimRightpoint-freesimpledbWebSocketajaximportTypeScriptrssslicelockfileexpressionacornconcatMapfindcreateoptionregexphttpswritablehttpwidthcollection.es6electroncallboundhigher-orderjestrgbunicodecoreES2017binaryreducerbabelfindLastIndexprefixmodulesstreamtexthashlinkworkspace:*Iteratorwaapirm -frsortedsearch-0privatejson-schema-validatorredact
6.7.109

10 months ago

6.7.108

10 months ago

6.7.107

10 months ago

6.7.106

10 months ago

6.7.105

10 months ago

6.7.104

10 months ago

6.7.103

10 months ago

6.7.102

10 months ago

6.7.101

10 months ago

6.6.101

10 months ago

6.6.100

10 months ago

6.6.99

10 months ago

6.5.99

10 months ago

6.5.98

10 months ago

6.5.97

10 months ago

6.5.96

10 months ago

6.5.95

11 months ago

6.5.94

11 months ago

5.5.94

11 months ago

5.5.93

11 months ago

5.5.92

11 months ago

5.5.91

11 months ago

5.5.90

11 months ago

5.5.89

11 months ago

5.5.88

11 months ago

5.5.87

11 months ago

5.5.86

11 months ago

5.5.85

11 months ago

5.5.84

11 months ago

5.5.83

11 months ago

5.5.82

11 months ago

5.5.81

11 months ago

5.5.80

11 months ago

5.4.80

11 months ago

4.4.80

11 months ago

4.4.79

11 months ago

4.4.78

11 months ago

4.4.77

11 months ago

4.4.76

11 months ago

4.4.75

11 months ago

4.4.74

11 months ago

4.4.73

11 months ago

4.4.72

11 months ago

3.4.72

11 months ago

3.4.71

11 months ago

3.4.70

11 months ago

3.4.69

12 months ago

3.4.68

12 months ago

3.3.68

12 months ago

3.3.67

12 months ago

3.3.66

12 months ago

3.3.65

12 months ago

3.3.64

12 months ago

3.3.63

12 months ago

3.3.62

12 months ago

3.3.61

12 months ago

2.3.61

12 months ago

2.3.60

12 months ago

2.3.59

12 months ago

2.3.58

12 months ago

2.3.57

12 months ago

2.2.57

12 months ago

2.2.56

12 months ago

2.2.55

12 months ago

2.2.54

12 months ago

1.2.54

12 months ago

1.2.53

1 year ago

1.2.52

1 year ago

1.2.51

1 year ago

1.2.50

1 year ago

1.2.49

1 year ago

1.2.48

1 year ago

1.2.47

1 year ago

1.2.46

1 year ago

1.2.45

1 year ago

1.2.44

1 year ago

1.2.43

1 year ago

1.2.42

1 year ago

1.2.41

1 year ago

1.2.40

1 year ago

1.2.39

1 year ago

1.2.38

1 year ago

1.2.37

1 year ago

1.2.36

1 year ago

1.2.35

1 year ago

1.2.34

1 year ago

1.2.33

1 year ago

1.2.32

1 year ago

1.2.31

1 year ago

1.2.30

1 year ago

1.2.29

1 year ago

1.2.28

1 year ago

1.2.27

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.2.24

1 year ago

1.2.23

1 year ago

1.2.22

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

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.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago