rambda 10.0.0-alpha.0 → 10.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +124 -16
  2. package/README.md +5526 -1730
  3. package/dist/{rambda.esm.js → rambda.cjs} +663 -355
  4. package/dist/rambda.js +545 -456
  5. package/dist/rambda.umd.js +563 -357
  6. package/immutable.d.ts +321 -343
  7. package/index.d.ts +321 -343
  8. package/package.json +20 -13
  9. package/rambda.js +16 -1
  10. package/src/addProp.js +3 -0
  11. package/src/append.js +5 -5
  12. package/src/ascend.js +16 -0
  13. package/src/compact.js +12 -0
  14. package/src/concat.js +1 -1
  15. package/src/count.js +7 -7
  16. package/src/countBy.js +12 -12
  17. package/src/createObjectFromKeys.js +10 -0
  18. package/src/descend.js +10 -0
  19. package/src/dropLast.js +1 -3
  20. package/src/eqProps.js +1 -2
  21. package/src/equals.js +2 -2
  22. package/src/evolve.js +2 -23
  23. package/src/filter.js +14 -14
  24. package/src/find.js +10 -10
  25. package/src/findIndex.js +9 -9
  26. package/src/findLast.js +8 -8
  27. package/src/findLastIndex.js +8 -8
  28. package/src/findNth.js +16 -0
  29. package/src/groupBy.js +14 -13
  30. package/src/includes.js +12 -13
  31. package/src/interpolate.js +29 -0
  32. package/src/intersection.js +1 -1
  33. package/src/intersperse.js +12 -12
  34. package/src/join.js +1 -1
  35. package/src/mapAsync.js +3 -3
  36. package/src/mapKeys.js +11 -0
  37. package/src/mapObjectAsync.js +9 -9
  38. package/src/mapParallelAsync.js +3 -0
  39. package/src/match.js +5 -5
  40. package/src/modifyProp.js +20 -0
  41. package/src/objectIncludes.js +12 -0
  42. package/src/partition.js +13 -37
  43. package/src/partitionObject.js +15 -0
  44. package/src/permutations.js +40 -0
  45. package/src/pipeAsync.js +7 -6
  46. package/src/pluck.js +9 -9
  47. package/src/prepend.js +1 -1
  48. package/src/propSatisfies.js +1 -3
  49. package/src/range.js +35 -12
  50. package/src/reject.js +1 -1
  51. package/src/rejectObject.js +13 -0
  52. package/src/shuffle.js +13 -0
  53. package/src/sort.js +1 -1
  54. package/src/sortBy.js +12 -10
  55. package/src/sortObject.js +15 -0
  56. package/src/sortWith.js +8 -8
  57. package/src/split.js +2 -2
  58. package/src/splitEvery.js +11 -11
  59. package/src/takeLastWhile.js +18 -18
  60. package/src/tap.js +4 -4
  61. package/src/test.js +1 -1
  62. package/src/uniqBy.js +4 -4
  63. package/src/uniqWith.js +10 -10
  64. package/src/modifyPath.js +0 -30
package/package.json CHANGED
@@ -1,21 +1,19 @@
1
1
  {
2
2
  "name": "rambda",
3
- "version": "10.0.0-alpha.0",
3
+ "version": "10.0.0-beta.1",
4
4
  "scripts": {
5
5
  "out": "yarn populatedocs && yarn populatereadme && yarn immutable && yarn build && yarn create-docsify",
6
6
  "build": "yarn build:main && yarn build:web && yarn build:esm",
7
- "build:main": "rollup rambda.js --file dist/rambda.js --format cjs",
8
- "build:esm": "rollup rambda.js --file dist/rambda.esm.js --format es",
7
+ "build:main": "rollup rambda.js --file dist/rambda.cjs --format cjs",
8
+ "build:esm": "rollup rambda.js --file dist/rambda.js --format es",
9
9
  "build:web": "rollup rambda.js --file dist/rambda.umd.js --format umd --name \"R\"",
10
- "immutable": "cd ../rambda-scripts && yarn immutable:rambda",
10
+ "immutable": "cd ../rambda-scripts && yarn immutable",
11
11
  "populatedocs": "cd ../rambda-scripts && yarn populate:docs",
12
12
  "populatereadme": "cd ../rambda-scripts && yarn populate:readme",
13
13
  "lint": "cd source && run lint:folder > lint-output.txt",
14
14
  "test:file": "node scripts/tasks/run/run-test.js",
15
15
  "test:ci": "vitest run",
16
16
  "test": "vitest run --watch -u",
17
- "x": "vitest run --watch source/and.spec.js",
18
- "test:cover": "vitest run --coverage",
19
17
  "test:typings": "dtslint --localTs ./node_modules/typescript/lib --expectOnly ./source",
20
18
  "create-docsify": "cd ../rambda-scripts && yarn create-docsify",
21
19
  "deps": "run dep:next",
@@ -27,20 +25,30 @@
27
25
  "depFn": [
28
26
  "@definitelytyped/dtslint"
29
27
  ],
28
+ "type": "module",
29
+ "exports": {
30
+ ".": {
31
+ "import": "./dist/rambda.js",
32
+ "require": "./dist/rambda.cjs"
33
+ }
34
+ },
35
+ "main": "dist/rambda.cjs",
36
+ "module": "dist/rambda.js",
30
37
  "dependencies": {},
31
38
  "devDependencies": {
32
39
  "@definitelytyped/dtslint": "0.0.182",
33
40
  "@types/mocha": "10.0.10",
34
- "@vitest/coverage-v8": "^3.0.5",
41
+ "@vitest/coverage-v8": "3.1.0-beta.2",
35
42
  "helpers-fn": "2.0.0",
36
43
  "lodash": "4.17.21",
44
+ "radashi": "^12.4.0",
37
45
  "rambdax": "11.3.1",
38
46
  "ramda": "0.30.1",
39
- "remeda": "^2.21.0",
40
- "rollup": "4.34.4",
47
+ "remeda": "2.21.2",
48
+ "rollup": "4.36.0",
41
49
  "types-ramda": "0.30.1",
42
- "typescript": "5.8.0-dev.20250206",
43
- "vitest": "3.0.5"
50
+ "typescript": "5.9.0-dev.20250321",
51
+ "vitest": "3.1.0-beta.2"
44
52
  },
45
53
  "jest": {
46
54
  "testEnvironment": "node",
@@ -68,6 +76,7 @@
68
76
  "generics",
69
77
  "lodash",
70
78
  "ramda",
79
+ "remeda",
71
80
  "stdlib",
72
81
  "toolkit",
73
82
  "ts",
@@ -90,8 +99,6 @@
90
99
  "immutable.js"
91
100
  ],
92
101
  "sideEffects": false,
93
- "main": "./dist/rambda.js",
94
102
  "umd": "./dist/rambda.umd.js",
95
- "module": "./rambda.js",
96
103
  "types": "./index.d.ts"
97
104
  }
package/rambda.js CHANGED
@@ -1,15 +1,20 @@
1
1
  /// <reference types="./index.d.ts" />
2
+ export * from './src/addProp.js'
2
3
  export * from './src/all.js'
3
4
  export * from './src/allPass.js'
4
5
  export * from './src/any.js'
5
6
  export * from './src/anyPass.js'
6
7
  export * from './src/append.js'
8
+ export * from './src/ascend.js'
7
9
  export * from './src/checkObjectWithSpec.js'
10
+ export * from './src/compact.js'
8
11
  export * from './src/complement.js'
9
12
  export * from './src/concat.js'
10
13
  export * from './src/count.js'
11
14
  export * from './src/countBy.js'
15
+ export * from './src/createObjectFromKeys.js'
12
16
  export * from './src/defaultTo.js'
17
+ export * from './src/descend.js'
13
18
  export * from './src/drop.js'
14
19
  export * from './src/dropLast.js'
15
20
  export * from './src/dropLastWhile.js'
@@ -25,6 +30,7 @@ export * from './src/find.js'
25
30
  export * from './src/findIndex.js'
26
31
  export * from './src/findLast.js'
27
32
  export * from './src/findLastIndex.js'
33
+ export * from './src/findNth.js'
28
34
  export * from './src/flatMap.js'
29
35
  export * from './src/flatten.js'
30
36
  export * from './src/groupBy.js'
@@ -33,6 +39,7 @@ export * from './src/includes.js'
33
39
  export * from './src/indexOf.js'
34
40
  export * from './src/init.js'
35
41
  export * from './src/innerJoin.js'
42
+ export * from './src/interpolate.js'
36
43
  export * from './src/intersection.js'
37
44
  export * from './src/intersperse.js'
38
45
  export * from './src/join.js'
@@ -40,19 +47,24 @@ export * from './src/last.js'
40
47
  export * from './src/lastIndexOf.js'
41
48
  export * from './src/map.js'
42
49
  export * from './src/mapAsync.js'
50
+ export * from './src/mapKeys.js'
43
51
  export * from './src/mapObject.js'
44
52
  export * from './src/mapObjectAsync.js'
53
+ export * from './src/mapParallelAsync.js'
45
54
  export * from './src/match.js'
46
55
  export * from './src/maxBy.js'
47
56
  export * from './src/merge.js'
48
57
  export * from './src/mergeTypes.js'
49
58
  export * from './src/minBy.js'
50
- export * from './src/modifyPath.js'
59
+ export * from './src/modifyProp.js'
51
60
  export * from './src/none.js'
52
61
  export * from './src/objOf.js'
62
+ export * from './src/objectIncludes.js'
53
63
  export * from './src/omit.js'
54
64
  export * from './src/partition.js'
65
+ export * from './src/partitionObject.js'
55
66
  export * from './src/path.js'
67
+ export * from './src/permutations.js'
56
68
  export * from './src/pick.js'
57
69
  export * from './src/pipe.js'
58
70
  export * from './src/pipeAsync.js'
@@ -65,10 +77,13 @@ export * from './src/propSatisfies.js'
65
77
  export * from './src/range.js'
66
78
  export * from './src/reduce.js'
67
79
  export * from './src/reject.js'
80
+ export * from './src/rejectObject.js'
68
81
  export * from './src/replace.js'
69
82
  export * from './src/replaceItemAtIndex.js'
83
+ export * from './src/shuffle.js'
70
84
  export * from './src/sort.js'
71
85
  export * from './src/sortBy.js'
86
+ export * from './src/sortObject.js'
72
87
  export * from './src/sortWith.js'
73
88
  export * from './src/split.js'
74
89
  export * from './src/splitEvery.js'
package/src/addProp.js ADDED
@@ -0,0 +1,3 @@
1
+ export function addProp(key, value) {
2
+ return obj => ({ ...obj, [key]: value })
3
+ }
package/src/append.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { cloneList } from './_internals/cloneList.js'
2
2
 
3
3
  export function append(x) {
4
- return list=> {
5
- const clone = cloneList(list)
6
- clone.push(x)
4
+ return list => {
5
+ const clone = cloneList(list)
6
+ clone.push(x)
7
7
 
8
- return clone
9
- }
8
+ return clone
9
+ }
10
10
  }
package/src/ascend.js ADDED
@@ -0,0 +1,16 @@
1
+ export function createCompareFunction(a, b, winner, loser) {
2
+ if (a === b) {
3
+ return 0
4
+ }
5
+
6
+ return a < b ? winner : loser
7
+ }
8
+
9
+ export function ascend(getFunction) {
10
+ return (a, b) => {
11
+ const aValue = getFunction(a)
12
+ const bValue = getFunction(b)
13
+
14
+ return createCompareFunction(aValue, bValue, -1, 1)
15
+ }
16
+ }
package/src/compact.js ADDED
@@ -0,0 +1,12 @@
1
+ import { isArray } from './_internals/isArray.js'
2
+ import { reject } from './reject.js'
3
+ import { rejectObject } from './rejectObject.js'
4
+
5
+ const isNullOrUndefined = x => x === null || x === undefined
6
+
7
+ export function compact(input){
8
+ if(isArray(input)){
9
+ return reject(isNullOrUndefined)(input)
10
+ }
11
+ return rejectObject(isNullOrUndefined)(input)
12
+ }
package/src/concat.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export function concat(x) {
2
- return y => typeof x === 'string' ? `${x}${y}` : [...x, ...y]
2
+ return y => (typeof x === 'string' ? `${x}${y}` : [...x, ...y])
3
3
  }
package/src/count.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { isArray } from './_internals/isArray.js'
2
2
 
3
- export function count(predicate, ) {
4
- return list => {
5
- if (!isArray(list)) {
6
- return 0
7
- }
3
+ export function count(predicate) {
4
+ return list => {
5
+ if (!isArray(list)) {
6
+ return 0
7
+ }
8
8
 
9
- return list.filter(x => predicate(x)).length
10
- }
9
+ return list.filter(x => predicate(x)).length
10
+ }
11
11
  }
package/src/countBy.js CHANGED
@@ -1,16 +1,16 @@
1
1
  export function countBy(fn) {
2
- return list => {
3
- const willReturn = {}
2
+ return list => {
3
+ const willReturn = {}
4
4
 
5
- list.forEach(item => {
6
- const key = fn(item)
7
- if (!willReturn[key]) {
8
- willReturn[key] = 1
9
- } else {
10
- willReturn[key]++
11
- }
12
- })
5
+ list.forEach(item => {
6
+ const key = fn(item)
7
+ if (!willReturn[key]) {
8
+ willReturn[key] = 1
9
+ } else {
10
+ willReturn[key]++
11
+ }
12
+ })
13
13
 
14
- return willReturn
15
- }
14
+ return willReturn
15
+ }
16
16
  }
@@ -0,0 +1,10 @@
1
+ export function createObjectFromKeys(keys) {
2
+ return fn => {
3
+ const result = {}
4
+ keys.forEach((key, index) => {
5
+ result[key] = fn(key, index)
6
+ })
7
+
8
+ return result
9
+ }
10
+ }
package/src/descend.js ADDED
@@ -0,0 +1,10 @@
1
+ import { createCompareFunction } from './ascend.js'
2
+
3
+ export function descend(getFunction) {
4
+ return (a, b) => {
5
+ const aValue = getFunction(a)
6
+ const bValue = getFunction(b)
7
+
8
+ return createCompareFunction(aValue, bValue, 1, -1)
9
+ }
10
+ }
package/src/dropLast.js CHANGED
@@ -1,5 +1,3 @@
1
1
  export function dropLast(numberItems) {
2
- return list => numberItems > 0
3
- ? list.slice(0, -numberItems)
4
- : list.slice()
2
+ return list => (numberItems > 0 ? list.slice(0, -numberItems) : list.slice())
5
3
  }
package/src/eqProps.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { equalsFn } from './equals.js'
2
- import { prop } from './prop.js'
3
2
 
4
3
  export function eqProps(property, objA) {
5
- return objB => equalsFn(prop(property)(objA), prop(property)(objB))
4
+ return objB => equalsFn( objA[property], objB[property] )
6
5
  }
package/src/equals.js CHANGED
@@ -98,7 +98,7 @@ function parseRegex(maybeRegex) {
98
98
  }
99
99
 
100
100
  export function equalsFn(a, b) {
101
- if (Object.is(a, b)) {
101
+ if (Object.is(a, b)) {
102
102
  return true
103
103
  }
104
104
 
@@ -207,5 +207,5 @@ export function equalsFn(a, b) {
207
207
  return false
208
208
  }
209
209
  export function equals(a) {
210
- return b => equalsFn(a, b)
210
+ return b => equalsFn(a, b)
211
211
  }
package/src/evolve.js CHANGED
@@ -1,27 +1,6 @@
1
1
  import { mapObject } from './mapObject.js'
2
2
  import { type } from './type.js'
3
3
 
4
- export function evolveFn(rules, obj) {
5
- return mapObject((x, prop) => {
6
- if (type(x) === 'Object') {
7
- const typeRule = type(rules[prop])
8
- if (typeRule === 'Function') {
9
- return rules[prop](x)
10
- }
11
- if (typeRule === 'Object') {
12
- return evolveFn(rules[prop], x)
13
- }
14
-
15
- return x
16
- }
17
- if (type(rules[prop]) === 'Function') {
18
- return rules[prop](x)
19
- }
20
-
21
- return x
22
- })(obj)
23
- }
24
-
25
4
  export function evolve(rules) {
26
- return obj => evolveFn(rules, obj)
27
- }
5
+ return mapObject((x, prop) => type(rules[prop]) === 'Function' ? rules[prop](x): x)
6
+ }
package/src/filter.js CHANGED
@@ -1,20 +1,20 @@
1
1
  export function filter(predicate) {
2
- return list => {
3
- if (!list) {
4
- throw new Error('Incorrect iterable input')
5
- }
6
- let index = 0
7
- const len = list.length
8
- const willReturn = []
2
+ return list => {
3
+ if (!list) {
4
+ throw new Error('Incorrect iterable input')
5
+ }
6
+ let index = 0
7
+ const len = list.length
8
+ const willReturn = []
9
+
10
+ while (index < len) {
11
+ if (predicate(list[index], index)) {
12
+ willReturn.push(list[index])
13
+ }
9
14
 
10
- while (index < len) {
11
- if (predicate(list[index], index)) {
12
- willReturn.push(list[index])
15
+ index++
13
16
  }
14
17
 
15
- index++
18
+ return willReturn
16
19
  }
17
-
18
- return willReturn
19
- }
20
20
  }
package/src/find.js CHANGED
@@ -1,15 +1,15 @@
1
1
  export function find(predicate) {
2
- return list => {
3
- let index = 0
4
- const len = list.length
2
+ return list => {
3
+ let index = 0
4
+ const len = list.length
5
5
 
6
- while (index < len) {
7
- const x = list[index]
8
- if (predicate(x)) {
9
- return x
10
- }
6
+ while (index < len) {
7
+ const x = list[index]
8
+ if (predicate(x)) {
9
+ return x
10
+ }
11
11
 
12
- index++
12
+ index++
13
+ }
13
14
  }
14
15
  }
15
- }
package/src/findIndex.js CHANGED
@@ -1,14 +1,14 @@
1
1
  export function findIndex(predicate) {
2
- return list => {
3
- const len = list.length
4
- let index = -1
2
+ return list => {
3
+ const len = list.length
4
+ let index = -1
5
5
 
6
- while (++index < len) {
7
- if (predicate(list[index])) {
8
- return index
6
+ while (++index < len) {
7
+ if (predicate(list[index])) {
8
+ return index
9
+ }
9
10
  }
10
- }
11
11
 
12
- return -1
13
- }
12
+ return -1
13
+ }
14
14
  }
package/src/findLast.js CHANGED
@@ -1,13 +1,13 @@
1
1
  export function findLast(predicate) {
2
- return list => {
3
- let index = list.length
2
+ return list => {
3
+ let index = list.length
4
4
 
5
- while (--index >= 0) {
6
- if (predicate(list[index])) {
7
- return list[index]
5
+ while (--index >= 0) {
6
+ if (predicate(list[index])) {
7
+ return list[index]
8
+ }
8
9
  }
9
- }
10
10
 
11
- return undefined
12
- }
11
+ return undefined
12
+ }
13
13
  }
@@ -1,13 +1,13 @@
1
1
  export function findLastIndex(fn) {
2
- return list => {
3
- let index = list.length
2
+ return list => {
3
+ let index = list.length
4
4
 
5
- while (--index >= 0) {
6
- if (fn(list[index])) {
7
- return index
5
+ while (--index >= 0) {
6
+ if (fn(list[index])) {
7
+ return index
8
+ }
8
9
  }
9
- }
10
10
 
11
- return -1
12
- }
11
+ return -1
12
+ }
13
13
  }
package/src/findNth.js ADDED
@@ -0,0 +1,16 @@
1
+ export function findNth(predicate, nth) {
2
+ return list => {
3
+ let index = 0
4
+ const len = list.length
5
+
6
+ while (index < len) {
7
+ const x = list[index]
8
+ if (predicate(x)) {
9
+ if (nth === 0) return x
10
+ nth--
11
+ }
12
+
13
+ index++
14
+ }
15
+ }
16
+ }
package/src/groupBy.js CHANGED
@@ -1,19 +1,20 @@
1
- export function groupBy(groupFn, list) {
2
- if (arguments.length === 1) {
3
- return _list => groupBy(groupFn, _list)
4
- }
1
+ export function groupByFallback(groupFn, list) {
2
+ const result = {}
3
+ for (let i = 0; i < list.length; i++) {
4
+ const item = list[i]
5
+ const key = groupFn(item)
5
6
 
6
- const result = {}
7
- for (let i = 0; i < list.length; i++) {
8
- const item = list[i]
9
- const key = groupFn(item)
7
+ if (!result[key]) {
8
+ result[key] = []
9
+ }
10
10
 
11
- if (!result[key]) {
12
- result[key] = []
11
+ result[key].push(item)
13
12
  }
14
13
 
15
- result[key].push(item)
16
- }
14
+ return result
15
+ }
16
+
17
17
 
18
- return result
18
+ export function groupBy(groupFn) {
19
+ return iterable => Object.groupBy ? Object.groupBy(iterable,groupFn) : groupByFallback(groupFn, iterable)
19
20
  }
package/src/includes.js CHANGED
@@ -2,18 +2,17 @@ import { isArray } from './_internals/isArray.js'
2
2
  import { _indexOf } from './equals.js'
3
3
 
4
4
  export function includes(valueToFind) {
5
- return iterable =>
6
- {
7
- if (typeof iterable === 'string') {
8
- return iterable.includes(valueToFind)
9
- }
10
- if (!iterable) {
11
- throw new TypeError(`Cannot read property \'indexOf\' of ${iterable}`)
12
- }
13
- if (!isArray(iterable)) {
14
- return false
15
- }
5
+ return iterable => {
6
+ if (typeof iterable === 'string') {
7
+ return iterable.includes(valueToFind)
8
+ }
9
+ if (!iterable) {
10
+ throw new TypeError(`Cannot read property \'indexOf\' of ${iterable}`)
11
+ }
12
+ if (!isArray(iterable)) {
13
+ return false
14
+ }
16
15
 
17
- return _indexOf(valueToFind, iterable) > -1
18
- }
16
+ return _indexOf(valueToFind, iterable) > -1
17
+ }
19
18
  }
@@ -0,0 +1,29 @@
1
+ const getOccurrences = input => input.match(/{{\s*.+?\s*}}/g)
2
+ const getOccurrenceProp = occurrence => occurrence.replace(/{{\s*|\s*}}/g, '')
3
+
4
+ const replace = ({ inputHolder, prop, replacer }) => {
5
+ const regexBase = `{{${prop}}}`
6
+ const regex = new RegExp(regexBase, 'g')
7
+ return inputHolder.replace(regex, replacer)
8
+ }
9
+
10
+ export function interpolate(input) {
11
+ return templateInput => {
12
+ const occurrences = getOccurrences(input)
13
+ if (occurrences === null) {
14
+ return input
15
+ }
16
+ let inputHolder = input
17
+
18
+ for (const occurrence of occurrences) {
19
+ const prop = getOccurrenceProp(occurrence)
20
+ inputHolder = replace({
21
+ inputHolder,
22
+ prop,
23
+ replacer: templateInput[prop],
24
+ })
25
+ }
26
+
27
+ return inputHolder
28
+ }
29
+ }
@@ -2,5 +2,5 @@ import { filter } from './filter.js'
2
2
  import { includes } from './includes.js'
3
3
 
4
4
  export function intersection(listA) {
5
- return listB =>filter(x => includes(x)(listA))(listB)
5
+ return listB => filter(x => includes(x)(listA))(listB)
6
6
  }
@@ -1,17 +1,17 @@
1
1
  export function intersperse(separator) {
2
- return list => {
3
- let index = -1
4
- const len = list.length
5
- const willReturn = []
2
+ return list => {
3
+ let index = -1
4
+ const len = list.length
5
+ const willReturn = []
6
6
 
7
- while (++index < len) {
8
- if (index === len - 1) {
9
- willReturn.push(list[index])
10
- } else {
11
- willReturn.push(list[index], separator)
7
+ while (++index < len) {
8
+ if (index === len - 1) {
9
+ willReturn.push(list[index])
10
+ } else {
11
+ willReturn.push(list[index], separator)
12
+ }
12
13
  }
13
- }
14
14
 
15
- return willReturn
16
- }
15
+ return willReturn
16
+ }
17
17
  }
package/src/join.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export function join(glue) {
2
- return list=> list.join(glue)
2
+ return list => list.join(glue)
3
3
  }
package/src/mapAsync.js CHANGED
@@ -1,11 +1,11 @@
1
1
  export function mapAsync(fn) {
2
- return async list => {
3
- const willReturn = []
2
+ return async list => {
3
+ const willReturn = []
4
4
  let i = 0
5
5
  for (const a of list) {
6
6
  willReturn.push(await fn(a, i++))
7
7
  }
8
8
 
9
9
  return willReturn
10
- }
10
+ }
11
11
  }