6.7.109 • Published 12 months ago

@patrtorg/vitae-sint v6.7.109

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

12 months ago

6.7.108

12 months ago

6.7.107

12 months ago

6.7.106

12 months ago

6.7.105

12 months ago

6.7.104

12 months ago

6.7.103

12 months ago

6.7.102

12 months ago

6.7.101

12 months ago

6.6.101

12 months ago

6.6.100

12 months ago

6.6.99

12 months ago

6.5.99

12 months ago

6.5.98

12 months ago

6.5.97

12 months ago

6.5.96

12 months ago

6.5.95

12 months ago

6.5.94

12 months ago

5.5.94

12 months ago

5.5.93

1 year ago

5.5.92

1 year ago

5.5.91

1 year ago

5.5.90

1 year ago

5.5.89

1 year ago

5.5.88

1 year ago

5.5.87

1 year ago

5.5.86

1 year ago

5.5.85

1 year ago

5.5.84

1 year ago

5.5.83

1 year ago

5.5.82

1 year ago

5.5.81

1 year ago

5.5.80

1 year ago

5.4.80

1 year ago

4.4.80

1 year ago

4.4.79

1 year ago

4.4.78

1 year ago

4.4.77

1 year ago

4.4.76

1 year ago

4.4.75

1 year ago

4.4.74

1 year ago

4.4.73

1 year ago

4.4.72

1 year ago

3.4.72

1 year ago

3.4.71

1 year ago

3.4.70

1 year ago

3.4.69

1 year ago

3.4.68

1 year ago

3.3.68

1 year ago

3.3.67

1 year ago

3.3.66

1 year ago

3.3.65

1 year ago

3.3.64

1 year ago

3.3.63

1 year ago

3.3.62

1 year ago

3.3.61

1 year ago

2.3.61

1 year ago

2.3.60

1 year ago

2.3.59

1 year ago

2.3.58

1 year ago

2.3.57

1 year ago

2.2.57

1 year ago

2.2.56

1 year ago

2.2.55

1 year ago

2.2.54

1 year ago

1.2.54

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