rambda 10.0.0-beta.3 → 10.0.0
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.
- package/CHANGELOG.md +2 -0
- package/README.md +5 -11
- package/dist/rambda.cjs +8 -8
- package/dist/rambda.js +8 -8
- package/dist/rambda.umd.js +8 -8
- package/index.d.ts +1 -3
- package/package.json +3 -6
- package/src/shuffle.js +2 -0
- package/immutable.d.ts +0 -2190
- package/immutable.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -124,6 +124,8 @@ _ Regarding using object as input with TypeScript in methods such as `R.map/filt
|
|
|
124
124
|
|
|
125
125
|
- Change `R.range` to work with descending order.
|
|
126
126
|
|
|
127
|
+
- Remove `rambda/immutable` as import option as it is hard to support in the new context.
|
|
128
|
+
|
|
127
129
|
- Sync with typing of `@types/ramda`:
|
|
128
130
|
|
|
129
131
|
-- allPass
|
package/README.md
CHANGED
|
@@ -101,14 +101,6 @@ Because of the focus on `R.pipe`, there is only one way to use each method. This
|
|
|
101
101
|
- All methods that 2 inputs, will have to be called with `R.methodName(input1)(input2)`
|
|
102
102
|
- All methods that 3 inputs, will have to be called with `R.methodName(input1, input2)(input3)`
|
|
103
103
|
|
|
104
|
-
### Immutable TS definitions
|
|
105
|
-
|
|
106
|
-
You can use immutable version of Rambda definitions, which is linted with ESLint `functional/prefer-readonly-type` plugin.
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
import {filter} from 'rambda/immutable'
|
|
110
|
-
```
|
|
111
|
-
|
|
112
104
|
### Deno support
|
|
113
105
|
|
|
114
106
|
```
|
|
@@ -4953,9 +4945,7 @@ const expected = 'foo is BAR even 1 more'
|
|
|
4953
4945
|
interpolate(inputWithTags: string): (templateArguments: object) => string;
|
|
4954
4946
|
|
|
4955
4947
|
// API_MARKER_END
|
|
4956
|
-
//
|
|
4957
|
-
|
|
4958
|
-
export as namespace R
|
|
4948
|
+
// ===========================================
|
|
4959
4949
|
```
|
|
4960
4950
|
|
|
4961
4951
|
</details>
|
|
@@ -9551,6 +9541,8 @@ shuffle<T>(list: T[]): T[];
|
|
|
9551
9541
|
<summary><strong>R.shuffle</strong> source</summary>
|
|
9552
9542
|
|
|
9553
9543
|
```javascript
|
|
9544
|
+
import { cloneList } from './_internals/cloneList.js'
|
|
9545
|
+
|
|
9554
9546
|
export function shuffle(listInput) {
|
|
9555
9547
|
const list = cloneList(listInput)
|
|
9556
9548
|
let counter = list.length
|
|
@@ -12842,6 +12834,8 @@ _ Regarding using object as input with TypeScript in methods such as `R.map/filt
|
|
|
12842
12834
|
|
|
12843
12835
|
- Change `R.range` to work with descending order.
|
|
12844
12836
|
|
|
12837
|
+
- Remove `rambda/immutable` as import option as it is hard to support in the new context.
|
|
12838
|
+
|
|
12845
12839
|
- Sync with typing of `@types/ramda`:
|
|
12846
12840
|
|
|
12847
12841
|
-- allPass
|
package/dist/rambda.cjs
CHANGED
|
@@ -87,11 +87,11 @@ function anyPass(predicates) {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
const cloneList
|
|
90
|
+
const cloneList = list => Array.prototype.slice.call(list);
|
|
91
91
|
|
|
92
92
|
function append(x) {
|
|
93
93
|
return list => {
|
|
94
|
-
const clone = cloneList
|
|
94
|
+
const clone = cloneList(list);
|
|
95
95
|
clone.push(x);
|
|
96
96
|
|
|
97
97
|
return clone
|
|
@@ -990,7 +990,7 @@ function modifyItemAtIndex(index, replaceFn) {
|
|
|
990
990
|
return list
|
|
991
991
|
}
|
|
992
992
|
|
|
993
|
-
const clone = cloneList
|
|
993
|
+
const clone = cloneList(list);
|
|
994
994
|
clone[actualIndex] = replaceFn(clone[actualIndex]);
|
|
995
995
|
|
|
996
996
|
return clone
|
|
@@ -999,7 +999,7 @@ function modifyItemAtIndex(index, replaceFn) {
|
|
|
999
999
|
|
|
1000
1000
|
function update(index, newValue) {
|
|
1001
1001
|
return list => {
|
|
1002
|
-
const clone = cloneList
|
|
1002
|
+
const clone = cloneList(list);
|
|
1003
1003
|
if (index === -1) {
|
|
1004
1004
|
return clone.fill(newValue, index)
|
|
1005
1005
|
}
|
|
@@ -1160,7 +1160,7 @@ function pathSatisfies(fn, pathInput) {
|
|
|
1160
1160
|
*/
|
|
1161
1161
|
function permutations(inputArray) {
|
|
1162
1162
|
const result = [];
|
|
1163
|
-
const array = cloneList
|
|
1163
|
+
const array = cloneList(inputArray);
|
|
1164
1164
|
const k = array.length;
|
|
1165
1165
|
if (k === 0) {
|
|
1166
1166
|
return result;
|
|
@@ -1420,7 +1420,7 @@ function shuffle(listInput) {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
|
|
1422
1422
|
function sort(sortFn) {
|
|
1423
|
-
return list => cloneList
|
|
1423
|
+
return list => cloneList(list).sort(sortFn)
|
|
1424
1424
|
}
|
|
1425
1425
|
|
|
1426
1426
|
function sortByFn (
|
|
@@ -1428,7 +1428,7 @@ function sortByFn (
|
|
|
1428
1428
|
list,
|
|
1429
1429
|
descending
|
|
1430
1430
|
){
|
|
1431
|
-
const clone = cloneList
|
|
1431
|
+
const clone = cloneList(list);
|
|
1432
1432
|
|
|
1433
1433
|
return clone.sort((a, b) => {
|
|
1434
1434
|
const aSortResult = sortFn(a);
|
|
@@ -1623,7 +1623,7 @@ function tryCatch(fn, fallback) {
|
|
|
1623
1623
|
|
|
1624
1624
|
function union(x) {
|
|
1625
1625
|
return y => {
|
|
1626
|
-
const toReturn = cloneList
|
|
1626
|
+
const toReturn = cloneList(x);
|
|
1627
1627
|
|
|
1628
1628
|
y.forEach(yInstance => {
|
|
1629
1629
|
if (!includes(yInstance)(x)) {
|
package/dist/rambda.js
CHANGED
|
@@ -85,11 +85,11 @@ function anyPass(predicates) {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
const cloneList
|
|
88
|
+
const cloneList = list => Array.prototype.slice.call(list);
|
|
89
89
|
|
|
90
90
|
function append(x) {
|
|
91
91
|
return list => {
|
|
92
|
-
const clone = cloneList
|
|
92
|
+
const clone = cloneList(list);
|
|
93
93
|
clone.push(x);
|
|
94
94
|
|
|
95
95
|
return clone
|
|
@@ -988,7 +988,7 @@ function modifyItemAtIndex(index, replaceFn) {
|
|
|
988
988
|
return list
|
|
989
989
|
}
|
|
990
990
|
|
|
991
|
-
const clone = cloneList
|
|
991
|
+
const clone = cloneList(list);
|
|
992
992
|
clone[actualIndex] = replaceFn(clone[actualIndex]);
|
|
993
993
|
|
|
994
994
|
return clone
|
|
@@ -997,7 +997,7 @@ function modifyItemAtIndex(index, replaceFn) {
|
|
|
997
997
|
|
|
998
998
|
function update(index, newValue) {
|
|
999
999
|
return list => {
|
|
1000
|
-
const clone = cloneList
|
|
1000
|
+
const clone = cloneList(list);
|
|
1001
1001
|
if (index === -1) {
|
|
1002
1002
|
return clone.fill(newValue, index)
|
|
1003
1003
|
}
|
|
@@ -1158,7 +1158,7 @@ function pathSatisfies(fn, pathInput) {
|
|
|
1158
1158
|
*/
|
|
1159
1159
|
function permutations(inputArray) {
|
|
1160
1160
|
const result = [];
|
|
1161
|
-
const array = cloneList
|
|
1161
|
+
const array = cloneList(inputArray);
|
|
1162
1162
|
const k = array.length;
|
|
1163
1163
|
if (k === 0) {
|
|
1164
1164
|
return result;
|
|
@@ -1418,7 +1418,7 @@ function shuffle(listInput) {
|
|
|
1418
1418
|
}
|
|
1419
1419
|
|
|
1420
1420
|
function sort(sortFn) {
|
|
1421
|
-
return list => cloneList
|
|
1421
|
+
return list => cloneList(list).sort(sortFn)
|
|
1422
1422
|
}
|
|
1423
1423
|
|
|
1424
1424
|
function sortByFn (
|
|
@@ -1426,7 +1426,7 @@ function sortByFn (
|
|
|
1426
1426
|
list,
|
|
1427
1427
|
descending
|
|
1428
1428
|
){
|
|
1429
|
-
const clone = cloneList
|
|
1429
|
+
const clone = cloneList(list);
|
|
1430
1430
|
|
|
1431
1431
|
return clone.sort((a, b) => {
|
|
1432
1432
|
const aSortResult = sortFn(a);
|
|
@@ -1621,7 +1621,7 @@ function tryCatch(fn, fallback) {
|
|
|
1621
1621
|
|
|
1622
1622
|
function union(x) {
|
|
1623
1623
|
return y => {
|
|
1624
|
-
const toReturn = cloneList
|
|
1624
|
+
const toReturn = cloneList(x);
|
|
1625
1625
|
|
|
1626
1626
|
y.forEach(yInstance => {
|
|
1627
1627
|
if (!includes(yInstance)(x)) {
|
package/dist/rambda.umd.js
CHANGED
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
const cloneList
|
|
94
|
+
const cloneList = list => Array.prototype.slice.call(list);
|
|
95
95
|
|
|
96
96
|
function append(x) {
|
|
97
97
|
return list => {
|
|
98
|
-
const clone = cloneList
|
|
98
|
+
const clone = cloneList(list);
|
|
99
99
|
clone.push(x);
|
|
100
100
|
|
|
101
101
|
return clone
|
|
@@ -994,7 +994,7 @@
|
|
|
994
994
|
return list
|
|
995
995
|
}
|
|
996
996
|
|
|
997
|
-
const clone = cloneList
|
|
997
|
+
const clone = cloneList(list);
|
|
998
998
|
clone[actualIndex] = replaceFn(clone[actualIndex]);
|
|
999
999
|
|
|
1000
1000
|
return clone
|
|
@@ -1003,7 +1003,7 @@
|
|
|
1003
1003
|
|
|
1004
1004
|
function update(index, newValue) {
|
|
1005
1005
|
return list => {
|
|
1006
|
-
const clone = cloneList
|
|
1006
|
+
const clone = cloneList(list);
|
|
1007
1007
|
if (index === -1) {
|
|
1008
1008
|
return clone.fill(newValue, index)
|
|
1009
1009
|
}
|
|
@@ -1164,7 +1164,7 @@
|
|
|
1164
1164
|
*/
|
|
1165
1165
|
function permutations(inputArray) {
|
|
1166
1166
|
const result = [];
|
|
1167
|
-
const array = cloneList
|
|
1167
|
+
const array = cloneList(inputArray);
|
|
1168
1168
|
const k = array.length;
|
|
1169
1169
|
if (k === 0) {
|
|
1170
1170
|
return result;
|
|
@@ -1424,7 +1424,7 @@
|
|
|
1424
1424
|
}
|
|
1425
1425
|
|
|
1426
1426
|
function sort(sortFn) {
|
|
1427
|
-
return list => cloneList
|
|
1427
|
+
return list => cloneList(list).sort(sortFn)
|
|
1428
1428
|
}
|
|
1429
1429
|
|
|
1430
1430
|
function sortByFn (
|
|
@@ -1432,7 +1432,7 @@
|
|
|
1432
1432
|
list,
|
|
1433
1433
|
descending
|
|
1434
1434
|
){
|
|
1435
|
-
const clone = cloneList
|
|
1435
|
+
const clone = cloneList(list);
|
|
1436
1436
|
|
|
1437
1437
|
return clone.sort((a, b) => {
|
|
1438
1438
|
const aSortResult = sortFn(a);
|
|
@@ -1627,7 +1627,7 @@
|
|
|
1627
1627
|
|
|
1628
1628
|
function union(x) {
|
|
1629
1629
|
return y => {
|
|
1630
|
-
const toReturn = cloneList
|
|
1630
|
+
const toReturn = cloneList(x);
|
|
1631
1631
|
|
|
1632
1632
|
y.forEach(yInstance => {
|
|
1633
1633
|
if (!includes(yInstance)(x)) {
|
package/index.d.ts
CHANGED
|
@@ -440,9 +440,7 @@ export function interpolate(inputWithTags: string): (templateArguments: object)
|
|
|
440
440
|
|
|
441
441
|
|
|
442
442
|
// API_MARKER_END
|
|
443
|
-
//
|
|
444
|
-
|
|
445
|
-
export as namespace R
|
|
443
|
+
// ===========================================
|
|
446
444
|
|
|
447
445
|
/**
|
|
448
446
|
* It loops through `listA` and `listB` and returns the intersection of the two according to `R.equals`.
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rambda",
|
|
3
|
-
"version": "10.0.0
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"out": "yarn populatedocs && yarn populatereadme && yarn
|
|
5
|
+
"out": "yarn populatedocs && yarn populatereadme && yarn build && yarn create-docsify",
|
|
6
6
|
"build": "yarn build:main && yarn build:web && yarn build:esm",
|
|
7
7
|
"build:main": "rollup rambda.js --file dist/rambda.cjs --format cjs",
|
|
8
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",
|
|
11
10
|
"populatedocs": "cd ../rambda-scripts && yarn populate:docs",
|
|
12
11
|
"populatereadme": "cd ../rambda-scripts && yarn populate:readme",
|
|
13
12
|
"lint": "cd source && run lint:folder > lint-output.txt",
|
|
@@ -94,9 +93,7 @@
|
|
|
94
93
|
"src",
|
|
95
94
|
"CHANGELOG.md",
|
|
96
95
|
"index.d.ts",
|
|
97
|
-
"
|
|
98
|
-
"rambda.js",
|
|
99
|
-
"immutable.js"
|
|
96
|
+
"rambda.js"
|
|
100
97
|
],
|
|
101
98
|
"sideEffects": false,
|
|
102
99
|
"umd": "./dist/rambda.umd.js",
|