rambda 8.1.0 → 8.2.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 +34 -22
- package/README.md +432 -273
- package/dist/rambda.js +173 -75
- package/dist/rambda.umd.js +1 -1
- package/immutable.d.ts +26 -0
- package/index.d.ts +26 -0
- package/package.json +24 -24
- package/rambda.js +7 -0
- package/src/_internals/utils.js +21 -0
- package/src/addIndex.js +23 -0
- package/src/addIndexRight.js +9 -0
- package/src/ap.js +7 -0
- package/src/aperture.js +15 -0
- package/src/applyTo.js +7 -0
- package/src/ascend.js +23 -0
- package/src/descend.js +17 -0
package/README.md
CHANGED
|
@@ -33,13 +33,13 @@ You can test this example in <a href="https://rambda.now.sh?const%20result%20%3D
|
|
|
33
33
|
|
|
34
34
|
## ❯ Rambda's advantages
|
|
35
35
|
|
|
36
|
-
###
|
|
36
|
+
### TypeScript included
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
TypeScript definitions are included in the library, in comparison to **Ramda**, where you need to additionally install `@types/ramda`.
|
|
39
39
|
|
|
40
|
-
Still, you need to be aware that functional programming features in `
|
|
40
|
+
Still, you need to be aware that functional programming features in `TypeScript` are in development, which means that using **R.compose/R.pipe** can be problematic.
|
|
41
41
|
|
|
42
|
-
Important - Rambda version `7.1.0`(or higher) requires
|
|
42
|
+
Important - Rambda version `7.1.0`(or higher) requires TypeScript version `4.3.3`(or higher).
|
|
43
43
|
|
|
44
44
|
#### Immutable TS definitions
|
|
45
45
|
|
|
@@ -96,16 +96,10 @@ Closing the issue is usually accompanied by publishing a new patch version of `R
|
|
|
96
96
|
|
|
97
97
|
<details>
|
|
98
98
|
<summary>
|
|
99
|
-
Click to see the full list of
|
|
99
|
+
Click to see the full list of 72 Ramda methods not implemented in Rambda
|
|
100
100
|
</summary>
|
|
101
101
|
|
|
102
102
|
- __
|
|
103
|
-
- addIndex
|
|
104
|
-
- addIndexRight
|
|
105
|
-
- ap
|
|
106
|
-
- aperture
|
|
107
|
-
- applyTo
|
|
108
|
-
- ascend
|
|
109
103
|
- binary
|
|
110
104
|
- call
|
|
111
105
|
- collectBy
|
|
@@ -113,7 +107,6 @@ Closing the issue is usually accompanied by publishing a new patch version of `R
|
|
|
113
107
|
- composeWith
|
|
114
108
|
- construct
|
|
115
109
|
- constructN
|
|
116
|
-
- descend
|
|
117
110
|
- dissocPath
|
|
118
111
|
- dropRepeatsBy
|
|
119
112
|
- empty
|
|
@@ -219,7 +212,7 @@ import {compose, add} from 'https://raw.githubusercontent.com/selfrefactor/rambd
|
|
|
219
212
|
|
|
220
213
|
- Error handling, when wrong inputs are provided, may not be the same. This difference will be better documented once all brute force tests are completed.
|
|
221
214
|
|
|
222
|
-
-
|
|
215
|
+
- TypeScript definitions between `rambda` and `@types/ramda` may vary.
|
|
223
216
|
|
|
224
217
|
> If you need more **Ramda** methods in **Rambda**, you may either submit a `PR` or check the extended version of **Rambda** - [Rambdax](https://github.com/selfrefactor/rambdax). In case of the former, you may want to consult with [Rambda contribution guidelines.](CONTRIBUTING.md)
|
|
225
218
|
|
|
@@ -340,6 +333,14 @@ It adds `a` and `b`.
|
|
|
340
333
|
|
|
341
334
|
[](#add)
|
|
342
335
|
|
|
336
|
+
### addIndex
|
|
337
|
+
|
|
338
|
+
[](#addIndex)
|
|
339
|
+
|
|
340
|
+
### addIndexRight
|
|
341
|
+
|
|
342
|
+
[](#addIndexRight)
|
|
343
|
+
|
|
343
344
|
### adjust
|
|
344
345
|
|
|
345
346
|
```typescript
|
|
@@ -353,7 +354,7 @@ It replaces `index` in array `list` with the result of `replaceFn(list[i])`.
|
|
|
353
354
|
|
|
354
355
|
<details>
|
|
355
356
|
|
|
356
|
-
<summary>All
|
|
357
|
+
<summary>All TypeScript definitions</summary>
|
|
357
358
|
|
|
358
359
|
```typescript
|
|
359
360
|
adjust<T>(index: number, replaceFn: (x: T) => T, list: T[]): T[];
|
|
@@ -453,7 +454,7 @@ It returns `true`, if all members of array `list` returns `true`, when applied a
|
|
|
453
454
|
|
|
454
455
|
<details>
|
|
455
456
|
|
|
456
|
-
<summary>All
|
|
457
|
+
<summary>All TypeScript definitions</summary>
|
|
457
458
|
|
|
458
459
|
```typescript
|
|
459
460
|
all<T>(predicate: (x: T) => boolean, list: T[]): boolean;
|
|
@@ -506,7 +507,7 @@ test('when false', () => {
|
|
|
506
507
|
|
|
507
508
|
<details>
|
|
508
509
|
|
|
509
|
-
<summary><strong>
|
|
510
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
510
511
|
|
|
511
512
|
```typescript
|
|
512
513
|
import {all} from 'rambda'
|
|
@@ -549,7 +550,7 @@ It returns `true`, if all functions of `predicates` return `true`, when `input`
|
|
|
549
550
|
|
|
550
551
|
<details>
|
|
551
552
|
|
|
552
|
-
<summary>All
|
|
553
|
+
<summary>All TypeScript definitions</summary>
|
|
553
554
|
|
|
554
555
|
```typescript
|
|
555
556
|
allPass<T>(predicates: ((x: T) => boolean)[]): (input: T) => boolean;
|
|
@@ -629,7 +630,7 @@ test('works with multiple inputs', () => {
|
|
|
629
630
|
|
|
630
631
|
<details>
|
|
631
632
|
|
|
632
|
-
<summary><strong>
|
|
633
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
633
634
|
|
|
634
635
|
```typescript
|
|
635
636
|
import {allPass, filter} from 'rambda'
|
|
@@ -702,7 +703,7 @@ It returns `true`, if at least one member of `list` returns true, when passed to
|
|
|
702
703
|
|
|
703
704
|
<details>
|
|
704
705
|
|
|
705
|
-
<summary>All
|
|
706
|
+
<summary>All TypeScript definitions</summary>
|
|
706
707
|
|
|
707
708
|
```typescript
|
|
708
709
|
any<T>(predicate: (x: T) => boolean, list: T[]): boolean;
|
|
@@ -755,7 +756,7 @@ test('with curry', () => {
|
|
|
755
756
|
|
|
756
757
|
<details>
|
|
757
758
|
|
|
758
|
-
<summary><strong>
|
|
759
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
759
760
|
|
|
760
761
|
```typescript
|
|
761
762
|
import {any} from 'rambda'
|
|
@@ -799,7 +800,7 @@ It accepts list of `predicates` and returns a function. This function with its `
|
|
|
799
800
|
|
|
800
801
|
<details>
|
|
801
802
|
|
|
802
|
-
<summary>All
|
|
803
|
+
<summary>All TypeScript definitions</summary>
|
|
803
804
|
|
|
804
805
|
```typescript
|
|
805
806
|
anyPass<T>(predicates: ((x: T) => boolean)[]): (input: T) => boolean;
|
|
@@ -892,7 +893,7 @@ test('works with multiple inputs', () => {
|
|
|
892
893
|
|
|
893
894
|
<details>
|
|
894
895
|
|
|
895
|
-
<summary><strong>
|
|
896
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
896
897
|
|
|
897
898
|
```typescript
|
|
898
899
|
import {anyPass, filter} from 'rambda'
|
|
@@ -936,6 +937,140 @@ describe('anyPass', () => {
|
|
|
936
937
|
|
|
937
938
|
[](#anyPass)
|
|
938
939
|
|
|
940
|
+
### ap
|
|
941
|
+
|
|
942
|
+
```typescript
|
|
943
|
+
|
|
944
|
+
ap<T, U>(fns: Array<(a: T) => U>[], vs: T[]): U[]
|
|
945
|
+
```
|
|
946
|
+
|
|
947
|
+
<details>
|
|
948
|
+
|
|
949
|
+
<summary>All TypeScript definitions</summary>
|
|
950
|
+
|
|
951
|
+
```typescript
|
|
952
|
+
ap<T, U>(fns: Array<(a: T) => U>[], vs: T[]): U[];
|
|
953
|
+
ap<T, U>(fns: Array<(a: T) => U>): (vs: T[]) => U[];
|
|
954
|
+
ap<R, A, B>(fn: (r: R, a: A) => B, fn1: (r: R) => A): (r: R) => B;
|
|
955
|
+
```
|
|
956
|
+
|
|
957
|
+
</details>
|
|
958
|
+
|
|
959
|
+
<details>
|
|
960
|
+
|
|
961
|
+
<summary><strong>R.ap</strong> source</summary>
|
|
962
|
+
|
|
963
|
+
```javascript
|
|
964
|
+
export function ap(functions, input){
|
|
965
|
+
if (arguments.length === 1){
|
|
966
|
+
return _inputs => ap(functions, _inputs)
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
return functions.reduce((acc, fn) => [ ...acc, ...input.map(fn) ], [])
|
|
970
|
+
}
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
</details>
|
|
974
|
+
|
|
975
|
+
<details>
|
|
976
|
+
|
|
977
|
+
<summary><strong>Tests</strong></summary>
|
|
978
|
+
|
|
979
|
+
```javascript
|
|
980
|
+
import { ap } from './ap.js'
|
|
981
|
+
|
|
982
|
+
function mult2(x){
|
|
983
|
+
return x * 2
|
|
984
|
+
}
|
|
985
|
+
function plus3(x){
|
|
986
|
+
return x + 3
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
test('happy', () => {
|
|
990
|
+
expect(ap([ mult2, plus3 ], [ 1, 2, 3 ])).toEqual([ 2, 4, 6, 4, 5, 6 ])
|
|
991
|
+
})
|
|
992
|
+
```
|
|
993
|
+
|
|
994
|
+
</details>
|
|
995
|
+
|
|
996
|
+
[](#ap)
|
|
997
|
+
|
|
998
|
+
### aperture
|
|
999
|
+
|
|
1000
|
+
```typescript
|
|
1001
|
+
|
|
1002
|
+
aperture<N extends number, T>(n: N, list: T[]): Array<Tuple<T, N>> | []
|
|
1003
|
+
```
|
|
1004
|
+
|
|
1005
|
+
<details>
|
|
1006
|
+
|
|
1007
|
+
<summary>All TypeScript definitions</summary>
|
|
1008
|
+
|
|
1009
|
+
```typescript
|
|
1010
|
+
aperture<N extends number, T>(n: N, list: T[]): Array<Tuple<T, N>> | [];
|
|
1011
|
+
aperture<N extends number>(n: N): <T>(list: T[]) => Array<Tuple<T, N>> | [];
|
|
1012
|
+
```
|
|
1013
|
+
|
|
1014
|
+
</details>
|
|
1015
|
+
|
|
1016
|
+
<details>
|
|
1017
|
+
|
|
1018
|
+
<summary><strong>R.aperture</strong> source</summary>
|
|
1019
|
+
|
|
1020
|
+
```javascript
|
|
1021
|
+
export function aperture(step, list){
|
|
1022
|
+
if (arguments.length === 1){
|
|
1023
|
+
return _list => aperture(step, _list)
|
|
1024
|
+
}
|
|
1025
|
+
if (step > list.length) return []
|
|
1026
|
+
let idx = 0
|
|
1027
|
+
const limit = list.length - (step - 1)
|
|
1028
|
+
const acc = new Array(limit)
|
|
1029
|
+
while (idx < limit){
|
|
1030
|
+
acc[ idx ] = list.slice(idx, idx + step)
|
|
1031
|
+
idx += 1
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
return acc
|
|
1035
|
+
}
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
</details>
|
|
1039
|
+
|
|
1040
|
+
<details>
|
|
1041
|
+
|
|
1042
|
+
<summary><strong>Tests</strong></summary>
|
|
1043
|
+
|
|
1044
|
+
```javascript
|
|
1045
|
+
import { aperture } from './aperture.js'
|
|
1046
|
+
|
|
1047
|
+
const list = [ 1, 2, 3, 4, 5, 6, 7 ]
|
|
1048
|
+
|
|
1049
|
+
test('happy', () => {
|
|
1050
|
+
expect(aperture(1, list)).toEqual([ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7 ] ])
|
|
1051
|
+
expect(aperture(2, list)).toEqual([
|
|
1052
|
+
[ 1, 2 ],
|
|
1053
|
+
[ 2, 3 ],
|
|
1054
|
+
[ 3, 4 ],
|
|
1055
|
+
[ 4, 5 ],
|
|
1056
|
+
[ 5, 6 ],
|
|
1057
|
+
[ 6, 7 ],
|
|
1058
|
+
])
|
|
1059
|
+
expect(aperture(3, list)).toEqual([
|
|
1060
|
+
[ 1, 2, 3 ],
|
|
1061
|
+
[ 2, 3, 4 ],
|
|
1062
|
+
[ 3, 4, 5 ],
|
|
1063
|
+
[ 4, 5, 6 ],
|
|
1064
|
+
[ 5, 6, 7 ],
|
|
1065
|
+
])
|
|
1066
|
+
expect(aperture(8, list)).toEqual([])
|
|
1067
|
+
})
|
|
1068
|
+
```
|
|
1069
|
+
|
|
1070
|
+
</details>
|
|
1071
|
+
|
|
1072
|
+
[](#aperture)
|
|
1073
|
+
|
|
939
1074
|
### append
|
|
940
1075
|
|
|
941
1076
|
```typescript
|
|
@@ -949,7 +1084,7 @@ It adds element `x` at the end of `list`.
|
|
|
949
1084
|
|
|
950
1085
|
<details>
|
|
951
1086
|
|
|
952
|
-
<summary>All
|
|
1087
|
+
<summary>All TypeScript definitions</summary>
|
|
953
1088
|
|
|
954
1089
|
```typescript
|
|
955
1090
|
append<T>(x: T, list: T[]): T[];
|
|
@@ -1007,7 +1142,7 @@ test('with strings', () => {
|
|
|
1007
1142
|
|
|
1008
1143
|
<details>
|
|
1009
1144
|
|
|
1010
|
-
<summary><strong>
|
|
1145
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
1011
1146
|
|
|
1012
1147
|
```typescript
|
|
1013
1148
|
import {append} from 'rambda'
|
|
@@ -1047,7 +1182,7 @@ This is useful for creating a fixed-arity function from a variadic function. `fn
|
|
|
1047
1182
|
|
|
1048
1183
|
<details>
|
|
1049
1184
|
|
|
1050
|
-
<summary>All
|
|
1185
|
+
<summary>All TypeScript definitions</summary>
|
|
1051
1186
|
|
|
1052
1187
|
```typescript
|
|
1053
1188
|
apply<T = any>(fn: (...args: any[]) => T, args: any[]): T;
|
|
@@ -1104,7 +1239,7 @@ test('provides no way to specify context', () => {
|
|
|
1104
1239
|
|
|
1105
1240
|
<details>
|
|
1106
1241
|
|
|
1107
|
-
<summary><strong>
|
|
1242
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
1108
1243
|
|
|
1109
1244
|
```typescript
|
|
1110
1245
|
import {apply, identity} from 'rambda'
|
|
@@ -1143,7 +1278,7 @@ applySpec<Spec extends Record<string, AnyFunction>>(
|
|
|
1143
1278
|
|
|
1144
1279
|
<details>
|
|
1145
1280
|
|
|
1146
|
-
<summary>All
|
|
1281
|
+
<summary>All TypeScript definitions</summary>
|
|
1147
1282
|
|
|
1148
1283
|
```typescript
|
|
1149
1284
|
applySpec<Spec extends Record<string, AnyFunction>>(
|
|
@@ -1538,7 +1673,7 @@ test('restructure json object', () => {
|
|
|
1538
1673
|
|
|
1539
1674
|
<details>
|
|
1540
1675
|
|
|
1541
|
-
<summary><strong>
|
|
1676
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
1542
1677
|
|
|
1543
1678
|
```typescript
|
|
1544
1679
|
import {multiply, applySpec, inc, dec, add} from 'rambda'
|
|
@@ -1570,6 +1705,14 @@ describe('applySpec', () => {
|
|
|
1570
1705
|
|
|
1571
1706
|
[](#applySpec)
|
|
1572
1707
|
|
|
1708
|
+
### applyTo
|
|
1709
|
+
|
|
1710
|
+
[](#applyTo)
|
|
1711
|
+
|
|
1712
|
+
### ascend
|
|
1713
|
+
|
|
1714
|
+
[](#ascend)
|
|
1715
|
+
|
|
1573
1716
|
### assoc
|
|
1574
1717
|
|
|
1575
1718
|
It makes a shallow clone of `obj` with setting or overriding the property `prop` with `newValue`.
|
|
@@ -1591,7 +1734,7 @@ It makes a shallow clone of `obj` with setting or overriding with `newValue` the
|
|
|
1591
1734
|
|
|
1592
1735
|
<details>
|
|
1593
1736
|
|
|
1594
|
-
<summary>All
|
|
1737
|
+
<summary>All TypeScript definitions</summary>
|
|
1595
1738
|
|
|
1596
1739
|
```typescript
|
|
1597
1740
|
assocPath<Output>(path: Path, newValue: any, obj: object): Output;
|
|
@@ -1846,7 +1989,7 @@ test('happy', () => {
|
|
|
1846
1989
|
|
|
1847
1990
|
<details>
|
|
1848
1991
|
|
|
1849
|
-
<summary><strong>
|
|
1992
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
1850
1993
|
|
|
1851
1994
|
```typescript
|
|
1852
1995
|
import {assocPath} from 'rambda'
|
|
@@ -1900,7 +2043,7 @@ Creates a function that is bound to a context.
|
|
|
1900
2043
|
|
|
1901
2044
|
<details>
|
|
1902
2045
|
|
|
1903
|
-
<summary>All
|
|
2046
|
+
<summary>All TypeScript definitions</summary>
|
|
1904
2047
|
|
|
1905
2048
|
```typescript
|
|
1906
2049
|
bind<F extends AnyFunction, T>(fn: F, thisObj: T): (...args: Parameters<F>) => ReturnType<F>;
|
|
@@ -2025,7 +2168,7 @@ test('preserves arity', () => {
|
|
|
2025
2168
|
|
|
2026
2169
|
<details>
|
|
2027
2170
|
|
|
2028
|
-
<summary><strong>
|
|
2171
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2029
2172
|
|
|
2030
2173
|
```typescript
|
|
2031
2174
|
import {bind} from 'rambda'
|
|
@@ -2064,7 +2207,7 @@ This function will return `true`, if both `firstCondition` and `secondCondition`
|
|
|
2064
2207
|
|
|
2065
2208
|
<details>
|
|
2066
2209
|
|
|
2067
|
-
<summary>All
|
|
2210
|
+
<summary>All TypeScript definitions</summary>
|
|
2068
2211
|
|
|
2069
2212
|
```typescript
|
|
2070
2213
|
both(pred1: Pred, pred2: Pred): Pred;
|
|
@@ -2142,7 +2285,7 @@ test('skip evaluation of the second expression', () => {
|
|
|
2142
2285
|
|
|
2143
2286
|
<details>
|
|
2144
2287
|
|
|
2145
|
-
<summary><strong>
|
|
2288
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2146
2289
|
|
|
2147
2290
|
```typescript
|
|
2148
2291
|
import {both} from 'rambda'
|
|
@@ -2208,7 +2351,7 @@ The method is also known as `flatMap`.
|
|
|
2208
2351
|
|
|
2209
2352
|
<details>
|
|
2210
2353
|
|
|
2211
|
-
<summary>All
|
|
2354
|
+
<summary>All TypeScript definitions</summary>
|
|
2212
2355
|
|
|
2213
2356
|
```typescript
|
|
2214
2357
|
chain<T, U>(fn: (n: T) => U[], list: T[]): U[];
|
|
@@ -2307,7 +2450,7 @@ test('@types/ramda broken test', () => {
|
|
|
2307
2450
|
|
|
2308
2451
|
<details>
|
|
2309
2452
|
|
|
2310
|
-
<summary><strong>
|
|
2453
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2311
2454
|
|
|
2312
2455
|
```typescript
|
|
2313
2456
|
import {chain} from 'rambda'
|
|
@@ -2419,7 +2562,7 @@ It counts elements in a list after each instance of the input list is passed thr
|
|
|
2419
2562
|
|
|
2420
2563
|
<details>
|
|
2421
2564
|
|
|
2422
|
-
<summary>All
|
|
2565
|
+
<summary>All TypeScript definitions</summary>
|
|
2423
2566
|
|
|
2424
2567
|
```typescript
|
|
2425
2568
|
countBy<T extends unknown>(transformFn: (x: T) => any, list: T[]): Record<string, number>;
|
|
@@ -2477,7 +2620,7 @@ test('happy', () => {
|
|
|
2477
2620
|
|
|
2478
2621
|
<details>
|
|
2479
2622
|
|
|
2480
|
-
<summary><strong>
|
|
2623
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2481
2624
|
|
|
2482
2625
|
```typescript
|
|
2483
2626
|
import {countBy} from 'rambda'
|
|
@@ -2538,7 +2681,7 @@ Else, it returns the first truthy `inputArguments` instance(from left to right).
|
|
|
2538
2681
|
|
|
2539
2682
|
<details>
|
|
2540
2683
|
|
|
2541
|
-
<summary>All
|
|
2684
|
+
<summary>All TypeScript definitions</summary>
|
|
2542
2685
|
|
|
2543
2686
|
```typescript
|
|
2544
2687
|
defaultTo<T>(defaultValue: T, input: T | null | undefined): T;
|
|
@@ -2605,7 +2748,7 @@ test('when inputArgument passes initial check', () => {
|
|
|
2605
2748
|
|
|
2606
2749
|
<details>
|
|
2607
2750
|
|
|
2608
|
-
<summary><strong>
|
|
2751
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2609
2752
|
|
|
2610
2753
|
```typescript
|
|
2611
2754
|
import {defaultTo} from 'rambda'
|
|
@@ -2626,6 +2769,10 @@ describe('R.defaultTo with Ramda spec', () => {
|
|
|
2626
2769
|
|
|
2627
2770
|
[](#defaultTo)
|
|
2628
2771
|
|
|
2772
|
+
### descend
|
|
2773
|
+
|
|
2774
|
+
[](#descend)
|
|
2775
|
+
|
|
2629
2776
|
### difference
|
|
2630
2777
|
|
|
2631
2778
|
```typescript
|
|
@@ -2641,7 +2788,7 @@ It returns the uniq set of all elements in the first list `a` not contained in t
|
|
|
2641
2788
|
|
|
2642
2789
|
<details>
|
|
2643
2790
|
|
|
2644
|
-
<summary>All
|
|
2791
|
+
<summary>All TypeScript definitions</summary>
|
|
2645
2792
|
|
|
2646
2793
|
```typescript
|
|
2647
2794
|
difference<T>(a: T[], b: T[]): T[];
|
|
@@ -2706,7 +2853,7 @@ test('should use R.equals', () => {
|
|
|
2706
2853
|
|
|
2707
2854
|
<details>
|
|
2708
2855
|
|
|
2709
|
-
<summary><strong>
|
|
2856
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2710
2857
|
|
|
2711
2858
|
```typescript
|
|
2712
2859
|
import {difference} from 'rambda'
|
|
@@ -2745,7 +2892,7 @@ differenceWith<T1, T2>(
|
|
|
2745
2892
|
|
|
2746
2893
|
<details>
|
|
2747
2894
|
|
|
2748
|
-
<summary>All
|
|
2895
|
+
<summary>All TypeScript definitions</summary>
|
|
2749
2896
|
|
|
2750
2897
|
```typescript
|
|
2751
2898
|
differenceWith<T1, T2>(
|
|
@@ -2844,7 +2991,7 @@ It returns `howMany` items dropped from beginning of list or string `input`.
|
|
|
2844
2991
|
|
|
2845
2992
|
<details>
|
|
2846
2993
|
|
|
2847
|
-
<summary>All
|
|
2994
|
+
<summary>All TypeScript definitions</summary>
|
|
2848
2995
|
|
|
2849
2996
|
```typescript
|
|
2850
2997
|
drop<T>(howMany: number, input: T[]): T[];
|
|
@@ -2908,7 +3055,7 @@ test('should return copy', () => {
|
|
|
2908
3055
|
|
|
2909
3056
|
<details>
|
|
2910
3057
|
|
|
2911
|
-
<summary><strong>
|
|
3058
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2912
3059
|
|
|
2913
3060
|
```typescript
|
|
2914
3061
|
import {drop} from 'rambda'
|
|
@@ -2957,7 +3104,7 @@ It returns `howMany` items dropped from the end of list or string `input`.
|
|
|
2957
3104
|
|
|
2958
3105
|
<details>
|
|
2959
3106
|
|
|
2960
|
-
<summary>All
|
|
3107
|
+
<summary>All TypeScript definitions</summary>
|
|
2961
3108
|
|
|
2962
3109
|
```typescript
|
|
2963
3110
|
dropLast<T>(howMany: number, input: T[]): T[];
|
|
@@ -3025,7 +3172,7 @@ test('should return copy', () => {
|
|
|
3025
3172
|
|
|
3026
3173
|
<details>
|
|
3027
3174
|
|
|
3028
|
-
<summary><strong>
|
|
3175
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
3029
3176
|
|
|
3030
3177
|
```typescript
|
|
3031
3178
|
import {dropLast} from 'rambda'
|
|
@@ -3080,7 +3227,7 @@ It removes any successive duplicates according to `R.equals`.
|
|
|
3080
3227
|
|
|
3081
3228
|
<details>
|
|
3082
3229
|
|
|
3083
|
-
<summary>All
|
|
3230
|
+
<summary>All TypeScript definitions</summary>
|
|
3084
3231
|
|
|
3085
3232
|
```typescript
|
|
3086
3233
|
dropRepeats<T>(list: T[]): T[];
|
|
@@ -3170,7 +3317,7 @@ describe('brute force', () => {
|
|
|
3170
3317
|
|
|
3171
3318
|
<details>
|
|
3172
3319
|
|
|
3173
|
-
<summary><strong>
|
|
3320
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
3174
3321
|
|
|
3175
3322
|
```typescript
|
|
3176
3323
|
import {dropRepeats} from 'rambda'
|
|
@@ -3215,7 +3362,7 @@ This `predicate` function will return `true`, if any of the two input predicates
|
|
|
3215
3362
|
|
|
3216
3363
|
<details>
|
|
3217
3364
|
|
|
3218
|
-
<summary>All
|
|
3365
|
+
<summary>All TypeScript definitions</summary>
|
|
3219
3366
|
|
|
3220
3367
|
```typescript
|
|
3221
3368
|
either(firstPredicate: Pred, secondPredicate: Pred): Pred;
|
|
@@ -3300,7 +3447,7 @@ test('case 2', () => {
|
|
|
3300
3447
|
|
|
3301
3448
|
<details>
|
|
3302
3449
|
|
|
3303
|
-
<summary><strong>
|
|
3450
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
3304
3451
|
|
|
3305
3452
|
```typescript
|
|
3306
3453
|
import {either} from 'rambda'
|
|
@@ -3367,7 +3514,7 @@ When iterable is a list, then it uses R.equals to determine if the target list e
|
|
|
3367
3514
|
|
|
3368
3515
|
<details>
|
|
3369
3516
|
|
|
3370
|
-
<summary>All
|
|
3517
|
+
<summary>All TypeScript definitions</summary>
|
|
3371
3518
|
|
|
3372
3519
|
```typescript
|
|
3373
3520
|
endsWith<T extends string>(question: T, str: string): boolean;
|
|
@@ -3478,7 +3625,7 @@ describe('brute force', () => {
|
|
|
3478
3625
|
|
|
3479
3626
|
<details>
|
|
3480
3627
|
|
|
3481
|
-
<summary><strong>
|
|
3628
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
3482
3629
|
|
|
3483
3630
|
```typescript
|
|
3484
3631
|
import {endsWith} from 'rambda'
|
|
@@ -3535,7 +3682,7 @@ It deeply compares `x` and `y` and returns `true` if they are equal.
|
|
|
3535
3682
|
|
|
3536
3683
|
<details>
|
|
3537
3684
|
|
|
3538
|
-
<summary>All
|
|
3685
|
+
<summary>All TypeScript definitions</summary>
|
|
3539
3686
|
|
|
3540
3687
|
```typescript
|
|
3541
3688
|
equals<T>(x: T, y: T): boolean;
|
|
@@ -4061,7 +4208,7 @@ describe('brute force', () => {
|
|
|
4061
4208
|
|
|
4062
4209
|
<details>
|
|
4063
4210
|
|
|
4064
|
-
<summary><strong>
|
|
4211
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4065
4212
|
|
|
4066
4213
|
```typescript
|
|
4067
4214
|
import {equals} from 'rambda'
|
|
@@ -4102,7 +4249,7 @@ It takes object or array of functions as set of rules. These `rules` are applied
|
|
|
4102
4249
|
|
|
4103
4250
|
<details>
|
|
4104
4251
|
|
|
4105
|
-
<summary>All
|
|
4252
|
+
<summary>All TypeScript definitions</summary>
|
|
4106
4253
|
|
|
4107
4254
|
```typescript
|
|
4108
4255
|
evolve<T, U>(rules: ((x: T) => U)[], list: T[]): U[];
|
|
@@ -4310,7 +4457,7 @@ describe('brute force', () => {
|
|
|
4310
4457
|
|
|
4311
4458
|
<details>
|
|
4312
4459
|
|
|
4313
|
-
<summary><strong>
|
|
4460
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4314
4461
|
|
|
4315
4462
|
```typescript
|
|
4316
4463
|
import {evolve, add} from 'rambda'
|
|
@@ -4365,7 +4512,7 @@ F(): boolean
|
|
|
4365
4512
|
|
|
4366
4513
|
<details>
|
|
4367
4514
|
|
|
4368
|
-
<summary>All
|
|
4515
|
+
<summary>All TypeScript definitions</summary>
|
|
4369
4516
|
|
|
4370
4517
|
```typescript
|
|
4371
4518
|
F(): boolean;
|
|
@@ -4400,7 +4547,7 @@ It filters list or object `input` using a `predicate` function.
|
|
|
4400
4547
|
|
|
4401
4548
|
<details>
|
|
4402
4549
|
|
|
4403
|
-
<summary>All
|
|
4550
|
+
<summary>All TypeScript definitions</summary>
|
|
4404
4551
|
|
|
4405
4552
|
```typescript
|
|
4406
4553
|
filter<T>(predicate: Predicate<T>): (input: T[]) => T[];
|
|
@@ -4541,7 +4688,7 @@ test('bad inputs difference between Ramda and Rambda', () => {
|
|
|
4541
4688
|
|
|
4542
4689
|
<details>
|
|
4543
4690
|
|
|
4544
|
-
<summary><strong>
|
|
4691
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4545
4692
|
|
|
4546
4693
|
```typescript
|
|
4547
4694
|
import {filter} from 'rambda'
|
|
@@ -4609,7 +4756,7 @@ If there is no such element, it returns `undefined`.
|
|
|
4609
4756
|
|
|
4610
4757
|
<details>
|
|
4611
4758
|
|
|
4612
|
-
<summary>All
|
|
4759
|
+
<summary>All TypeScript definitions</summary>
|
|
4613
4760
|
|
|
4614
4761
|
```typescript
|
|
4615
4762
|
find<T>(predicate: (x: T) => boolean, list: T[]): T | undefined;
|
|
@@ -4671,7 +4818,7 @@ test('with empty list', () => {
|
|
|
4671
4818
|
|
|
4672
4819
|
<details>
|
|
4673
4820
|
|
|
4674
|
-
<summary><strong>
|
|
4821
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4675
4822
|
|
|
4676
4823
|
```typescript
|
|
4677
4824
|
import {find} from 'rambda'
|
|
@@ -4711,7 +4858,7 @@ If there is no such element, then `-1` is returned.
|
|
|
4711
4858
|
|
|
4712
4859
|
<details>
|
|
4713
4860
|
|
|
4714
|
-
<summary>All
|
|
4861
|
+
<summary>All TypeScript definitions</summary>
|
|
4715
4862
|
|
|
4716
4863
|
```typescript
|
|
4717
4864
|
findIndex<T>(predicate: (x: T) => boolean, list: T[]): number;
|
|
@@ -4764,7 +4911,7 @@ test('happy', () => {
|
|
|
4764
4911
|
|
|
4765
4912
|
<details>
|
|
4766
4913
|
|
|
4767
|
-
<summary><strong>
|
|
4914
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4768
4915
|
|
|
4769
4916
|
```typescript
|
|
4770
4917
|
import {findIndex} from 'rambda'
|
|
@@ -4804,7 +4951,7 @@ If there is no such element, then `undefined` is returned.
|
|
|
4804
4951
|
|
|
4805
4952
|
<details>
|
|
4806
4953
|
|
|
4807
|
-
<summary>All
|
|
4954
|
+
<summary>All TypeScript definitions</summary>
|
|
4808
4955
|
|
|
4809
4956
|
```typescript
|
|
4810
4957
|
findLast<T>(fn: (x: T) => boolean, list: T[]): T | undefined;
|
|
@@ -4893,7 +5040,7 @@ test('ramda 4', () => {
|
|
|
4893
5040
|
|
|
4894
5041
|
<details>
|
|
4895
5042
|
|
|
4896
|
-
<summary><strong>
|
|
5043
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4897
5044
|
|
|
4898
5045
|
```typescript
|
|
4899
5046
|
import {findLast} from 'rambda'
|
|
@@ -4933,7 +5080,7 @@ If there is no such element, then `-1` is returned.
|
|
|
4933
5080
|
|
|
4934
5081
|
<details>
|
|
4935
5082
|
|
|
4936
|
-
<summary>All
|
|
5083
|
+
<summary>All TypeScript definitions</summary>
|
|
4937
5084
|
|
|
4938
5085
|
```typescript
|
|
4939
5086
|
findLastIndex<T>(predicate: (x: T) => boolean, list: T[]): number;
|
|
@@ -5023,7 +5170,7 @@ test('ramda 4', () => {
|
|
|
5023
5170
|
|
|
5024
5171
|
<details>
|
|
5025
5172
|
|
|
5026
|
-
<summary><strong>
|
|
5173
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5027
5174
|
|
|
5028
5175
|
```typescript
|
|
5029
5176
|
import {findLastIndex} from 'rambda'
|
|
@@ -5061,7 +5208,7 @@ It deeply flattens an array.
|
|
|
5061
5208
|
|
|
5062
5209
|
<details>
|
|
5063
5210
|
|
|
5064
|
-
<summary>All
|
|
5211
|
+
<summary>All TypeScript definitions</summary>
|
|
5065
5212
|
|
|
5066
5213
|
```typescript
|
|
5067
5214
|
flatten<T>(list: any[]): T[];
|
|
@@ -5120,7 +5267,7 @@ test('readme example', () => {
|
|
|
5120
5267
|
|
|
5121
5268
|
<details>
|
|
5122
5269
|
|
|
5123
|
-
<summary><strong>
|
|
5270
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5124
5271
|
|
|
5125
5272
|
```typescript
|
|
5126
5273
|
import {flatten} from 'rambda'
|
|
@@ -5158,7 +5305,7 @@ It applies `iterable` function over all members of `list` and returns `list`.
|
|
|
5158
5305
|
|
|
5159
5306
|
<details>
|
|
5160
5307
|
|
|
5161
|
-
<summary>All
|
|
5308
|
+
<summary>All TypeScript definitions</summary>
|
|
5162
5309
|
|
|
5163
5310
|
```typescript
|
|
5164
5311
|
forEach<T>(fn: Iterator<T, void>, list: T[]): T[];
|
|
@@ -5282,7 +5429,7 @@ test('returns the input', () => {
|
|
|
5282
5429
|
|
|
5283
5430
|
<details>
|
|
5284
5431
|
|
|
5285
|
-
<summary><strong>
|
|
5432
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5286
5433
|
|
|
5287
5434
|
```typescript
|
|
5288
5435
|
import {forEach} from 'rambda'
|
|
@@ -5374,7 +5521,7 @@ It returns `true` if `obj` has property `prop`.
|
|
|
5374
5521
|
|
|
5375
5522
|
<details>
|
|
5376
5523
|
|
|
5377
|
-
<summary>All
|
|
5524
|
+
<summary>All TypeScript definitions</summary>
|
|
5378
5525
|
|
|
5379
5526
|
```typescript
|
|
5380
5527
|
has<T>(prop: string, obj: T): boolean;
|
|
@@ -5424,7 +5571,7 @@ test('with non-object', () => {
|
|
|
5424
5571
|
|
|
5425
5572
|
<details>
|
|
5426
5573
|
|
|
5427
|
-
<summary><strong>
|
|
5574
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5428
5575
|
|
|
5429
5576
|
```typescript
|
|
5430
5577
|
import {has} from 'rambda'
|
|
@@ -5459,7 +5606,7 @@ It will return true, if `input` object has truthy `path`(calculated with `R.path
|
|
|
5459
5606
|
|
|
5460
5607
|
<details>
|
|
5461
5608
|
|
|
5462
|
-
<summary>All
|
|
5609
|
+
<summary>All TypeScript definitions</summary>
|
|
5463
5610
|
|
|
5464
5611
|
```typescript
|
|
5465
5612
|
hasPath<T>(
|
|
@@ -5523,7 +5670,7 @@ test('when false', () => {
|
|
|
5523
5670
|
|
|
5524
5671
|
<details>
|
|
5525
5672
|
|
|
5526
|
-
<summary><strong>
|
|
5673
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5527
5674
|
|
|
5528
5675
|
```typescript
|
|
5529
5676
|
import {hasPath} from 'rambda'
|
|
@@ -5563,7 +5710,7 @@ It returns the first element of list or string `input`.
|
|
|
5563
5710
|
|
|
5564
5711
|
<details>
|
|
5565
5712
|
|
|
5566
|
-
<summary>All
|
|
5713
|
+
<summary>All TypeScript definitions</summary>
|
|
5567
5714
|
|
|
5568
5715
|
```typescript
|
|
5569
5716
|
head(input: string): string;
|
|
@@ -5606,7 +5753,7 @@ test('head', () => {
|
|
|
5606
5753
|
|
|
5607
5754
|
<details>
|
|
5608
5755
|
|
|
5609
|
-
<summary><strong>
|
|
5756
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5610
5757
|
|
|
5611
5758
|
```typescript
|
|
5612
5759
|
import {mixedList, mixedListConst} from '_internals/typescriptTestUtils'
|
|
@@ -5668,7 +5815,7 @@ It just passes back the supplied `input` argument.
|
|
|
5668
5815
|
|
|
5669
5816
|
<details>
|
|
5670
5817
|
|
|
5671
|
-
<summary>All
|
|
5818
|
+
<summary>All TypeScript definitions</summary>
|
|
5672
5819
|
|
|
5673
5820
|
```typescript
|
|
5674
5821
|
identity<T>(input: T): T;
|
|
@@ -5706,7 +5853,7 @@ test('happy', () => {
|
|
|
5706
5853
|
|
|
5707
5854
|
<details>
|
|
5708
5855
|
|
|
5709
|
-
<summary><strong>
|
|
5856
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5710
5857
|
|
|
5711
5858
|
```typescript
|
|
5712
5859
|
import {identity} from 'rambda'
|
|
@@ -5742,7 +5889,7 @@ When `fn`` is called with `input` argument, it will return either `onTrue(input)
|
|
|
5742
5889
|
|
|
5743
5890
|
<details>
|
|
5744
5891
|
|
|
5745
|
-
<summary>All
|
|
5892
|
+
<summary>All TypeScript definitions</summary>
|
|
5746
5893
|
|
|
5747
5894
|
```typescript
|
|
5748
5895
|
ifElse<T, TFiltered extends T, TOnTrueResult, TOnFalseResult>(
|
|
@@ -5885,7 +6032,7 @@ test('simple arity of 2', () => {
|
|
|
5885
6032
|
|
|
5886
6033
|
<details>
|
|
5887
6034
|
|
|
5888
|
-
<summary><strong>
|
|
6035
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5889
6036
|
|
|
5890
6037
|
```typescript
|
|
5891
6038
|
import {ifElse} from 'rambda'
|
|
@@ -5958,7 +6105,7 @@ If `input` is array, then `R.equals` is used to define if `valueToFind` belongs
|
|
|
5958
6105
|
|
|
5959
6106
|
<details>
|
|
5960
6107
|
|
|
5961
|
-
<summary>All
|
|
6108
|
+
<summary>All TypeScript definitions</summary>
|
|
5962
6109
|
|
|
5963
6110
|
```typescript
|
|
5964
6111
|
includes<T extends string>(valueToFind: T, input: string): boolean;
|
|
@@ -6059,7 +6206,7 @@ test('throws on wrong input - match ramda behaviour', () => {
|
|
|
6059
6206
|
|
|
6060
6207
|
<details>
|
|
6061
6208
|
|
|
6062
|
-
<summary><strong>
|
|
6209
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6063
6210
|
|
|
6064
6211
|
```typescript
|
|
6065
6212
|
import {includes} from 'rambda'
|
|
@@ -6123,7 +6270,7 @@ It returns all but the last element of list or string `input`.
|
|
|
6123
6270
|
|
|
6124
6271
|
<details>
|
|
6125
6272
|
|
|
6126
|
-
<summary>All
|
|
6273
|
+
<summary>All TypeScript definitions</summary>
|
|
6127
6274
|
|
|
6128
6275
|
```typescript
|
|
6129
6276
|
init<T extends unknown[]>(input: T): T extends readonly [...infer U, any] ? U : [...T];
|
|
@@ -6179,7 +6326,7 @@ test('with string', () => {
|
|
|
6179
6326
|
|
|
6180
6327
|
<details>
|
|
6181
6328
|
|
|
6182
|
-
<summary><strong>
|
|
6329
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6183
6330
|
|
|
6184
6331
|
```typescript
|
|
6185
6332
|
import {init} from 'rambda'
|
|
@@ -6244,7 +6391,7 @@ It returns `true` if `x` is `empty`.
|
|
|
6244
6391
|
|
|
6245
6392
|
<details>
|
|
6246
6393
|
|
|
6247
|
-
<summary>All
|
|
6394
|
+
<summary>All TypeScript definitions</summary>
|
|
6248
6395
|
|
|
6249
6396
|
```typescript
|
|
6250
6397
|
isEmpty<T>(x: T): boolean;
|
|
@@ -6306,7 +6453,7 @@ test('happy', () => {
|
|
|
6306
6453
|
|
|
6307
6454
|
<details>
|
|
6308
6455
|
|
|
6309
|
-
<summary><strong>
|
|
6456
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6310
6457
|
|
|
6311
6458
|
```typescript
|
|
6312
6459
|
import {isEmpty} from 'rambda'
|
|
@@ -6336,7 +6483,7 @@ It returns `true` if `x` is either `null` or `undefined`.
|
|
|
6336
6483
|
|
|
6337
6484
|
<details>
|
|
6338
6485
|
|
|
6339
|
-
<summary>All
|
|
6486
|
+
<summary>All TypeScript definitions</summary>
|
|
6340
6487
|
|
|
6341
6488
|
```typescript
|
|
6342
6489
|
isNil(x: any): x is null | undefined;
|
|
@@ -6389,7 +6536,7 @@ It returns a string of all `list` instances joined with a `glue`.
|
|
|
6389
6536
|
|
|
6390
6537
|
<details>
|
|
6391
6538
|
|
|
6392
|
-
<summary>All
|
|
6539
|
+
<summary>All TypeScript definitions</summary>
|
|
6393
6540
|
|
|
6394
6541
|
```typescript
|
|
6395
6542
|
join<T>(glue: string, list: T[]): string;
|
|
@@ -6434,7 +6581,7 @@ test('curry', () => {
|
|
|
6434
6581
|
|
|
6435
6582
|
<details>
|
|
6436
6583
|
|
|
6437
|
-
<summary><strong>
|
|
6584
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6438
6585
|
|
|
6439
6586
|
```typescript
|
|
6440
6587
|
import {join} from 'rambda'
|
|
@@ -6464,7 +6611,7 @@ It applies list of function to a list of inputs.
|
|
|
6464
6611
|
|
|
6465
6612
|
<details>
|
|
6466
6613
|
|
|
6467
|
-
<summary>All
|
|
6614
|
+
<summary>All TypeScript definitions</summary>
|
|
6468
6615
|
|
|
6469
6616
|
```typescript
|
|
6470
6617
|
juxt<A extends any[], R1>(fns: [(...a: A) => R1]): (...a: A) => [R1];
|
|
@@ -6509,7 +6656,7 @@ test('happy', () => {
|
|
|
6509
6656
|
|
|
6510
6657
|
<details>
|
|
6511
6658
|
|
|
6512
|
-
<summary><strong>
|
|
6659
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6513
6660
|
|
|
6514
6661
|
```typescript
|
|
6515
6662
|
import {juxt} from 'rambda'
|
|
@@ -6540,7 +6687,7 @@ It applies `Object.keys` over `x` and returns its keys.
|
|
|
6540
6687
|
|
|
6541
6688
|
<details>
|
|
6542
6689
|
|
|
6543
|
-
<summary>All
|
|
6690
|
+
<summary>All TypeScript definitions</summary>
|
|
6544
6691
|
|
|
6545
6692
|
```typescript
|
|
6546
6693
|
keys<T extends object>(x: T): (keyof T)[];
|
|
@@ -6577,7 +6724,7 @@ test('happy', () => {
|
|
|
6577
6724
|
|
|
6578
6725
|
<details>
|
|
6579
6726
|
|
|
6580
|
-
<summary><strong>
|
|
6727
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6581
6728
|
|
|
6582
6729
|
```typescript
|
|
6583
6730
|
import {keys} from 'rambda'
|
|
@@ -6609,7 +6756,7 @@ It returns the last element of `input`, as the `input` can be either a string or
|
|
|
6609
6756
|
|
|
6610
6757
|
<details>
|
|
6611
6758
|
|
|
6612
|
-
<summary>All
|
|
6759
|
+
<summary>All TypeScript definitions</summary>
|
|
6613
6760
|
|
|
6614
6761
|
```typescript
|
|
6615
6762
|
last(input: string): string;
|
|
@@ -6657,7 +6804,7 @@ test('with string', () => {
|
|
|
6657
6804
|
|
|
6658
6805
|
<details>
|
|
6659
6806
|
|
|
6660
|
-
<summary><strong>
|
|
6807
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6661
6808
|
|
|
6662
6809
|
```typescript
|
|
6663
6810
|
import {mixedList, mixedListConst} from '_internals/typescriptTestUtils'
|
|
@@ -6713,7 +6860,7 @@ If there is no such index, then `-1` is returned.
|
|
|
6713
6860
|
|
|
6714
6861
|
<details>
|
|
6715
6862
|
|
|
6716
|
-
<summary>All
|
|
6863
|
+
<summary>All TypeScript definitions</summary>
|
|
6717
6864
|
|
|
6718
6865
|
```typescript
|
|
6719
6866
|
lastIndexOf<T>(target: T, list: T[]): number;
|
|
@@ -6810,7 +6957,7 @@ describe('brute force', () => {
|
|
|
6810
6957
|
|
|
6811
6958
|
<details>
|
|
6812
6959
|
|
|
6813
|
-
<summary><strong>
|
|
6960
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6814
6961
|
|
|
6815
6962
|
```typescript
|
|
6816
6963
|
import {lastIndexOf} from 'rambda'
|
|
@@ -6846,7 +6993,7 @@ It returns the `length` property of list or string `input`.
|
|
|
6846
6993
|
|
|
6847
6994
|
<details>
|
|
6848
6995
|
|
|
6849
|
-
<summary>All
|
|
6996
|
+
<summary>All TypeScript definitions</summary>
|
|
6850
6997
|
|
|
6851
6998
|
```typescript
|
|
6852
6999
|
length<T>(input: T[]): number;
|
|
@@ -6932,7 +7079,7 @@ The setter should not mutate the data structure.
|
|
|
6932
7079
|
|
|
6933
7080
|
<details>
|
|
6934
7081
|
|
|
6935
|
-
<summary>All
|
|
7082
|
+
<summary>All TypeScript definitions</summary>
|
|
6936
7083
|
|
|
6937
7084
|
```typescript
|
|
6938
7085
|
lens<T, U, V>(getter: (s: T) => U, setter: (a: U, s: T) => V): Lens;
|
|
@@ -6958,7 +7105,7 @@ export function lens(getter, setter){
|
|
|
6958
7105
|
|
|
6959
7106
|
<details>
|
|
6960
7107
|
|
|
6961
|
-
<summary><strong>
|
|
7108
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6962
7109
|
|
|
6963
7110
|
```typescript
|
|
6964
7111
|
import {lens, assoc} from 'rambda'
|
|
@@ -6995,7 +7142,7 @@ It returns a lens that focuses on specified `index`.
|
|
|
6995
7142
|
|
|
6996
7143
|
<details>
|
|
6997
7144
|
|
|
6998
|
-
<summary>All
|
|
7145
|
+
<summary>All TypeScript definitions</summary>
|
|
6999
7146
|
|
|
7000
7147
|
```typescript
|
|
7001
7148
|
lensIndex(index: number): Lens;
|
|
@@ -7086,7 +7233,7 @@ test('get (set(set s v1) v2) === v2', () => {
|
|
|
7086
7233
|
|
|
7087
7234
|
<details>
|
|
7088
7235
|
|
|
7089
|
-
<summary><strong>
|
|
7236
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7090
7237
|
|
|
7091
7238
|
```typescript
|
|
7092
7239
|
import {view, lensIndex} from 'rambda'
|
|
@@ -7122,7 +7269,7 @@ It returns a lens that focuses on specified `path`.
|
|
|
7122
7269
|
|
|
7123
7270
|
<details>
|
|
7124
7271
|
|
|
7125
|
-
<summary>All
|
|
7272
|
+
<summary>All TypeScript definitions</summary>
|
|
7126
7273
|
|
|
7127
7274
|
```typescript
|
|
7128
7275
|
lensPath(path: RamdaPath): Lens;
|
|
@@ -7282,7 +7429,7 @@ test('get (set(set s v1) v2) === v2', () => {
|
|
|
7282
7429
|
|
|
7283
7430
|
<details>
|
|
7284
7431
|
|
|
7285
|
-
<summary><strong>
|
|
7432
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7286
7433
|
|
|
7287
7434
|
```typescript
|
|
7288
7435
|
import {lensPath, view} from 'rambda'
|
|
@@ -7336,7 +7483,7 @@ It returns a lens that focuses on specified property `prop`.
|
|
|
7336
7483
|
|
|
7337
7484
|
<details>
|
|
7338
7485
|
|
|
7339
|
-
<summary>All
|
|
7486
|
+
<summary>All TypeScript definitions</summary>
|
|
7340
7487
|
|
|
7341
7488
|
```typescript
|
|
7342
7489
|
lensProp(prop: string): {
|
|
@@ -7468,7 +7615,7 @@ test('get (set(set s v1) v2) === v2', () => {
|
|
|
7468
7615
|
|
|
7469
7616
|
<details>
|
|
7470
7617
|
|
|
7471
|
-
<summary><strong>
|
|
7618
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7472
7619
|
|
|
7473
7620
|
```typescript
|
|
7474
7621
|
import {lensProp, view} from 'rambda'
|
|
@@ -7510,7 +7657,7 @@ It works with both array and object.
|
|
|
7510
7657
|
|
|
7511
7658
|
<details>
|
|
7512
7659
|
|
|
7513
|
-
<summary>All
|
|
7660
|
+
<summary>All TypeScript definitions</summary>
|
|
7514
7661
|
|
|
7515
7662
|
```typescript
|
|
7516
7663
|
map<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;
|
|
@@ -7651,7 +7798,7 @@ test('bad inputs difference between Ramda and Rambda', () => {
|
|
|
7651
7798
|
|
|
7652
7799
|
<details>
|
|
7653
7800
|
|
|
7654
|
-
<summary><strong>
|
|
7801
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7655
7802
|
|
|
7656
7803
|
```typescript
|
|
7657
7804
|
import {map} from 'rambda'
|
|
@@ -7752,7 +7899,7 @@ It works the same way as `R.map` does for objects. It is added as Ramda also has
|
|
|
7752
7899
|
|
|
7753
7900
|
<details>
|
|
7754
7901
|
|
|
7755
|
-
<summary>All
|
|
7902
|
+
<summary>All TypeScript definitions</summary>
|
|
7756
7903
|
|
|
7757
7904
|
```typescript
|
|
7758
7905
|
mapObjIndexed<T>(fn: ObjectIterator<T, T>, iterable: Dictionary<T>): Dictionary<T>;
|
|
@@ -7765,7 +7912,7 @@ mapObjIndexed<T, U>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dict
|
|
|
7765
7912
|
|
|
7766
7913
|
<details>
|
|
7767
7914
|
|
|
7768
|
-
<summary><strong>
|
|
7915
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7769
7916
|
|
|
7770
7917
|
```typescript
|
|
7771
7918
|
import {mapObjIndexed} from 'rambda'
|
|
@@ -7829,7 +7976,7 @@ Curried version of `String.prototype.match` which returns empty array, when ther
|
|
|
7829
7976
|
|
|
7830
7977
|
<details>
|
|
7831
7978
|
|
|
7832
|
-
<summary>All
|
|
7979
|
+
<summary>All TypeScript definitions</summary>
|
|
7833
7980
|
|
|
7834
7981
|
```typescript
|
|
7835
7982
|
match(regExpression: RegExp, str: string): string[];
|
|
@@ -7886,7 +8033,7 @@ test('throwing', () => {
|
|
|
7886
8033
|
|
|
7887
8034
|
<details>
|
|
7888
8035
|
|
|
7889
|
-
<summary><strong>
|
|
8036
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7890
8037
|
|
|
7891
8038
|
```typescript
|
|
7892
8039
|
import {match} from 'rambda'
|
|
@@ -7946,7 +8093,7 @@ It returns the mean value of `list` input.
|
|
|
7946
8093
|
|
|
7947
8094
|
<details>
|
|
7948
8095
|
|
|
7949
|
-
<summary>All
|
|
8096
|
+
<summary>All TypeScript definitions</summary>
|
|
7950
8097
|
|
|
7951
8098
|
```typescript
|
|
7952
8099
|
mean(list: number[]): number;
|
|
@@ -7988,7 +8135,7 @@ test('with NaN', () => {
|
|
|
7988
8135
|
|
|
7989
8136
|
<details>
|
|
7990
8137
|
|
|
7991
|
-
<summary><strong>
|
|
8138
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7992
8139
|
|
|
7993
8140
|
```typescript
|
|
7994
8141
|
import {mean} from 'rambda'
|
|
@@ -8019,7 +8166,7 @@ It returns the median value of `list` input.
|
|
|
8019
8166
|
|
|
8020
8167
|
<details>
|
|
8021
8168
|
|
|
8022
|
-
<summary>All
|
|
8169
|
+
<summary>All TypeScript definitions</summary>
|
|
8023
8170
|
|
|
8024
8171
|
```typescript
|
|
8025
8172
|
median(list: number[]): number;
|
|
@@ -8074,7 +8221,7 @@ test('with empty array', () => {
|
|
|
8074
8221
|
|
|
8075
8222
|
<details>
|
|
8076
8223
|
|
|
8077
|
-
<summary><strong>
|
|
8224
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8078
8225
|
|
|
8079
8226
|
```typescript
|
|
8080
8227
|
import {median} from 'rambda'
|
|
@@ -8111,7 +8258,7 @@ It merges all objects of `list` array sequentially and returns the result.
|
|
|
8111
8258
|
|
|
8112
8259
|
<details>
|
|
8113
8260
|
|
|
8114
|
-
<summary>All
|
|
8261
|
+
<summary>All TypeScript definitions</summary>
|
|
8115
8262
|
|
|
8116
8263
|
```typescript
|
|
8117
8264
|
mergeAll<T>(list: object[]): T;
|
|
@@ -8193,7 +8340,7 @@ describe('acts as if nil values are simply empty objects', () => {
|
|
|
8193
8340
|
|
|
8194
8341
|
<details>
|
|
8195
8342
|
|
|
8196
|
-
<summary><strong>
|
|
8343
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8197
8344
|
|
|
8198
8345
|
```typescript
|
|
8199
8346
|
import {mergeAll} from 'rambda'
|
|
@@ -8234,7 +8381,7 @@ Creates a new object with the own properties of the first object merged with the
|
|
|
8234
8381
|
|
|
8235
8382
|
<details>
|
|
8236
8383
|
|
|
8237
|
-
<summary>All
|
|
8384
|
+
<summary>All TypeScript definitions</summary>
|
|
8238
8385
|
|
|
8239
8386
|
```typescript
|
|
8240
8387
|
mergeDeepRight<Output>(target: object, newProps: object): Output;
|
|
@@ -8414,7 +8561,7 @@ test('functions are not discarded', () => {
|
|
|
8414
8561
|
|
|
8415
8562
|
<details>
|
|
8416
8563
|
|
|
8417
|
-
<summary><strong>
|
|
8564
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8418
8565
|
|
|
8419
8566
|
```typescript
|
|
8420
8567
|
import {mergeDeepRight} from 'rambda'
|
|
@@ -8448,7 +8595,7 @@ Same as `R.merge`, but in opposite direction.
|
|
|
8448
8595
|
|
|
8449
8596
|
<details>
|
|
8450
8597
|
|
|
8451
|
-
<summary>All
|
|
8598
|
+
<summary>All TypeScript definitions</summary>
|
|
8452
8599
|
|
|
8453
8600
|
```typescript
|
|
8454
8601
|
mergeLeft<Output>(newProps: object, target: object): Output;
|
|
@@ -8512,7 +8659,7 @@ test('when undefined or null instead of object', () => {
|
|
|
8512
8659
|
|
|
8513
8660
|
<details>
|
|
8514
8661
|
|
|
8515
|
-
<summary><strong>
|
|
8662
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8516
8663
|
|
|
8517
8664
|
```typescript
|
|
8518
8665
|
import {mergeLeft} from 'rambda'
|
|
@@ -8557,7 +8704,7 @@ It takes two objects and a function, which will be used when there is an overlap
|
|
|
8557
8704
|
|
|
8558
8705
|
<details>
|
|
8559
8706
|
|
|
8560
|
-
<summary>All
|
|
8707
|
+
<summary>All TypeScript definitions</summary>
|
|
8561
8708
|
|
|
8562
8709
|
```typescript
|
|
8563
8710
|
mergeWith(fn: (x: any, z: any) => any, a: Record<string, unknown>, b: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -8676,7 +8823,7 @@ describe('acts as if nil values are simply empty objects', () => {
|
|
|
8676
8823
|
|
|
8677
8824
|
<details>
|
|
8678
8825
|
|
|
8679
|
-
<summary><strong>
|
|
8826
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8680
8827
|
|
|
8681
8828
|
```typescript
|
|
8682
8829
|
import {concat, mergeWith} from 'rambda'
|
|
@@ -8758,7 +8905,7 @@ modify<T extends object, K extends keyof T, P>(
|
|
|
8758
8905
|
|
|
8759
8906
|
<details>
|
|
8760
8907
|
|
|
8761
|
-
<summary>All
|
|
8908
|
+
<summary>All TypeScript definitions</summary>
|
|
8762
8909
|
|
|
8763
8910
|
```typescript
|
|
8764
8911
|
modify<T extends object, K extends keyof T, P>(
|
|
@@ -8907,7 +9054,7 @@ describe('brute force', () => {
|
|
|
8907
9054
|
|
|
8908
9055
|
<details>
|
|
8909
9056
|
|
|
8910
|
-
<summary><strong>
|
|
9057
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8911
9058
|
|
|
8912
9059
|
```typescript
|
|
8913
9060
|
import {modify, add} from 'rambda'
|
|
@@ -8946,7 +9093,7 @@ It changes a property of object on the base of provided path and transformer fun
|
|
|
8946
9093
|
|
|
8947
9094
|
<details>
|
|
8948
9095
|
|
|
8949
|
-
<summary>All
|
|
9096
|
+
<summary>All TypeScript definitions</summary>
|
|
8950
9097
|
|
|
8951
9098
|
```typescript
|
|
8952
9099
|
modifyPath<T extends Record<string, unknown>>(path: Path, fn: (x: any) => unknown, object: Record<string, unknown>): T;
|
|
@@ -9025,7 +9172,7 @@ test('with array', () => {
|
|
|
9025
9172
|
|
|
9026
9173
|
<details>
|
|
9027
9174
|
|
|
9028
|
-
<summary><strong>
|
|
9175
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9029
9176
|
|
|
9030
9177
|
```typescript
|
|
9031
9178
|
import {modifyPath} from 'rambda'
|
|
@@ -9094,7 +9241,7 @@ It returns `true`, if all members of array `list` returns `false`, when applied
|
|
|
9094
9241
|
|
|
9095
9242
|
<details>
|
|
9096
9243
|
|
|
9097
|
-
<summary>All
|
|
9244
|
+
<summary>All TypeScript definitions</summary>
|
|
9098
9245
|
|
|
9099
9246
|
```typescript
|
|
9100
9247
|
none<T>(predicate: (x: T) => boolean, list: T[]): boolean;
|
|
@@ -9143,7 +9290,7 @@ test('when false curried', () => {
|
|
|
9143
9290
|
|
|
9144
9291
|
<details>
|
|
9145
9292
|
|
|
9146
|
-
<summary><strong>
|
|
9293
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9147
9294
|
|
|
9148
9295
|
```typescript
|
|
9149
9296
|
import {none} from 'rambda'
|
|
@@ -9186,7 +9333,7 @@ It returns a boolean negated version of `input`.
|
|
|
9186
9333
|
|
|
9187
9334
|
<details>
|
|
9188
9335
|
|
|
9189
|
-
<summary>All
|
|
9336
|
+
<summary>All TypeScript definitions</summary>
|
|
9190
9337
|
|
|
9191
9338
|
```typescript
|
|
9192
9339
|
not(input: any): boolean;
|
|
@@ -9225,7 +9372,7 @@ test('not', () => {
|
|
|
9225
9372
|
|
|
9226
9373
|
<details>
|
|
9227
9374
|
|
|
9228
|
-
<summary><strong>
|
|
9375
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9229
9376
|
|
|
9230
9377
|
```typescript
|
|
9231
9378
|
import {not} from 'rambda'
|
|
@@ -9256,7 +9403,7 @@ Curried version of `input[index]`.
|
|
|
9256
9403
|
|
|
9257
9404
|
<details>
|
|
9258
9405
|
|
|
9259
|
-
<summary>All
|
|
9406
|
+
<summary>All TypeScript definitions</summary>
|
|
9260
9407
|
|
|
9261
9408
|
```typescript
|
|
9262
9409
|
nth(index: number, input: string): string;
|
|
@@ -9319,7 +9466,7 @@ test('with negative index', () => {
|
|
|
9319
9466
|
|
|
9320
9467
|
<details>
|
|
9321
9468
|
|
|
9322
|
-
<summary><strong>
|
|
9469
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9323
9470
|
|
|
9324
9471
|
```typescript
|
|
9325
9472
|
import {nth} from 'rambda'
|
|
@@ -9377,7 +9524,7 @@ of<T>(x: T): T[]
|
|
|
9377
9524
|
|
|
9378
9525
|
<details>
|
|
9379
9526
|
|
|
9380
|
-
<summary>All
|
|
9527
|
+
<summary>All TypeScript definitions</summary>
|
|
9381
9528
|
|
|
9382
9529
|
```typescript
|
|
9383
9530
|
of<T>(x: T): T[];
|
|
@@ -9415,7 +9562,7 @@ test('happy', () => {
|
|
|
9415
9562
|
|
|
9416
9563
|
<details>
|
|
9417
9564
|
|
|
9418
|
-
<summary><strong>
|
|
9565
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9419
9566
|
|
|
9420
9567
|
```typescript
|
|
9421
9568
|
import {of} from 'rambda'
|
|
@@ -9453,7 +9600,7 @@ It returns a partial copy of an `obj` without `propsToOmit` properties.
|
|
|
9453
9600
|
|
|
9454
9601
|
<details>
|
|
9455
9602
|
|
|
9456
|
-
<summary>All
|
|
9603
|
+
<summary>All TypeScript definitions</summary>
|
|
9457
9604
|
|
|
9458
9605
|
```typescript
|
|
9459
9606
|
omit<T, K extends string>(propsToOmit: K[], obj: T): Omit<T, K>;
|
|
@@ -9543,7 +9690,7 @@ test('happy', () => {
|
|
|
9543
9690
|
|
|
9544
9691
|
<details>
|
|
9545
9692
|
|
|
9546
|
-
<summary><strong>
|
|
9693
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9547
9694
|
|
|
9548
9695
|
```typescript
|
|
9549
9696
|
import {omit} from 'rambda'
|
|
@@ -9654,7 +9801,7 @@ It returns a function, which invokes only once `fn` function.
|
|
|
9654
9801
|
|
|
9655
9802
|
<details>
|
|
9656
9803
|
|
|
9657
|
-
<summary>All
|
|
9804
|
+
<summary>All TypeScript definitions</summary>
|
|
9658
9805
|
|
|
9659
9806
|
```typescript
|
|
9660
9807
|
once<T extends AnyFunction>(func: T): T;
|
|
@@ -9732,7 +9879,7 @@ test('happy path', () => {
|
|
|
9732
9879
|
|
|
9733
9880
|
<details>
|
|
9734
9881
|
|
|
9735
|
-
<summary><strong>
|
|
9882
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9736
9883
|
|
|
9737
9884
|
```typescript
|
|
9738
9885
|
import {once} from 'rambda'
|
|
@@ -9774,7 +9921,7 @@ It returns a copied **Object** or **Array** with modified value received by appl
|
|
|
9774
9921
|
|
|
9775
9922
|
<details>
|
|
9776
9923
|
|
|
9777
|
-
<summary>All
|
|
9924
|
+
<summary>All TypeScript definitions</summary>
|
|
9778
9925
|
|
|
9779
9926
|
```typescript
|
|
9780
9927
|
over<T>(lens: Lens, fn: Arity1Fn, value: T): T;
|
|
@@ -9885,7 +10032,7 @@ The name comes from the fact that you partially inject the inputs.
|
|
|
9885
10032
|
|
|
9886
10033
|
<details>
|
|
9887
10034
|
|
|
9888
|
-
<summary>All
|
|
10035
|
+
<summary>All TypeScript definitions</summary>
|
|
9889
10036
|
|
|
9890
10037
|
```typescript
|
|
9891
10038
|
partial<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: [V0]): (x1: V1) => T;
|
|
@@ -9992,7 +10139,7 @@ test('ramda spec', () => {
|
|
|
9992
10139
|
|
|
9993
10140
|
<details>
|
|
9994
10141
|
|
|
9995
|
-
<summary><strong>
|
|
10142
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9996
10143
|
|
|
9997
10144
|
```typescript
|
|
9998
10145
|
import {partial} from 'rambda'
|
|
@@ -10038,7 +10185,7 @@ Initially the function knows only a part from the whole input object and then `R
|
|
|
10038
10185
|
|
|
10039
10186
|
<details>
|
|
10040
10187
|
|
|
10041
|
-
<summary>All
|
|
10188
|
+
<summary>All TypeScript definitions</summary>
|
|
10042
10189
|
|
|
10043
10190
|
```typescript
|
|
10044
10191
|
partialObject<Input, PartialInput, Output>(
|
|
@@ -10138,7 +10285,7 @@ test('async function throwing an error', async () => {
|
|
|
10138
10285
|
|
|
10139
10286
|
<details>
|
|
10140
10287
|
|
|
10141
|
-
<summary><strong>
|
|
10288
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10142
10289
|
|
|
10143
10290
|
```typescript
|
|
10144
10291
|
import {partialObject, delay} from 'rambda'
|
|
@@ -10198,7 +10345,7 @@ It will return array of two objects/arrays according to `predicate` function. Th
|
|
|
10198
10345
|
|
|
10199
10346
|
<details>
|
|
10200
10347
|
|
|
10201
|
-
<summary>All
|
|
10348
|
+
<summary>All TypeScript definitions</summary>
|
|
10202
10349
|
|
|
10203
10350
|
```typescript
|
|
10204
10351
|
partition<T>(
|
|
@@ -10348,7 +10495,7 @@ test('readme example', () => {
|
|
|
10348
10495
|
|
|
10349
10496
|
<details>
|
|
10350
10497
|
|
|
10351
|
-
<summary><strong>
|
|
10498
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10352
10499
|
|
|
10353
10500
|
```typescript
|
|
10354
10501
|
import {partition} from 'rambda'
|
|
@@ -10411,7 +10558,7 @@ It will return `undefined`, if such path is not found.
|
|
|
10411
10558
|
|
|
10412
10559
|
<details>
|
|
10413
10560
|
|
|
10414
|
-
<summary>All
|
|
10561
|
+
<summary>All TypeScript definitions</summary>
|
|
10415
10562
|
|
|
10416
10563
|
```typescript
|
|
10417
10564
|
path<S, K0 extends keyof S = keyof S>(path: [K0], obj: S): S[K0];
|
|
@@ -10538,7 +10685,7 @@ test('null is not a valid path', () => {
|
|
|
10538
10685
|
|
|
10539
10686
|
<details>
|
|
10540
10687
|
|
|
10541
|
-
<summary><strong>
|
|
10688
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10542
10689
|
|
|
10543
10690
|
```typescript
|
|
10544
10691
|
import {path} from 'rambda'
|
|
@@ -10618,7 +10765,7 @@ It returns `true` if `pathToSearch` of `input` object is equal to `target` value
|
|
|
10618
10765
|
|
|
10619
10766
|
<details>
|
|
10620
10767
|
|
|
10621
|
-
<summary>All
|
|
10768
|
+
<summary>All TypeScript definitions</summary>
|
|
10622
10769
|
|
|
10623
10770
|
```typescript
|
|
10624
10771
|
pathEq(pathToSearch: Path, target: any, input: any): boolean;
|
|
@@ -10688,7 +10835,7 @@ test('when wrong path', () => {
|
|
|
10688
10835
|
|
|
10689
10836
|
<details>
|
|
10690
10837
|
|
|
10691
|
-
<summary><strong>
|
|
10838
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10692
10839
|
|
|
10693
10840
|
```typescript
|
|
10694
10841
|
import {pathEq} from 'rambda'
|
|
@@ -10752,7 +10899,7 @@ It reads `obj` input and returns either `R.path(pathToSearch, Record<string, unk
|
|
|
10752
10899
|
|
|
10753
10900
|
<details>
|
|
10754
10901
|
|
|
10755
|
-
<summary>All
|
|
10902
|
+
<summary>All TypeScript definitions</summary>
|
|
10756
10903
|
|
|
10757
10904
|
```typescript
|
|
10758
10905
|
pathOr<T>(defaultValue: T, pathToSearch: Path, obj: any): T;
|
|
@@ -10836,7 +10983,7 @@ test('curry case (x,y)(z)', () => {
|
|
|
10836
10983
|
|
|
10837
10984
|
<details>
|
|
10838
10985
|
|
|
10839
|
-
<summary><strong>
|
|
10986
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10840
10987
|
|
|
10841
10988
|
```typescript
|
|
10842
10989
|
import {pathOr} from 'rambda'
|
|
@@ -10880,7 +11027,7 @@ Because it calls `R.path`, then `singlePath` can be either string or a list.
|
|
|
10880
11027
|
|
|
10881
11028
|
<details>
|
|
10882
11029
|
|
|
10883
|
-
<summary>All
|
|
11030
|
+
<summary>All TypeScript definitions</summary>
|
|
10884
11031
|
|
|
10885
11032
|
```typescript
|
|
10886
11033
|
paths<Input, T>(pathsToSearch: Path[], obj: Input): (T | undefined)[];
|
|
@@ -10978,7 +11125,7 @@ test('returns undefined for items not found', () => {
|
|
|
10978
11125
|
|
|
10979
11126
|
<details>
|
|
10980
11127
|
|
|
10981
|
-
<summary><strong>
|
|
11128
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10982
11129
|
|
|
10983
11130
|
```typescript
|
|
10984
11131
|
import {paths} from 'rambda'
|
|
@@ -11035,7 +11182,7 @@ String annotation of `propsToPick` is one of the differences between `Rambda` an
|
|
|
11035
11182
|
|
|
11036
11183
|
<details>
|
|
11037
11184
|
|
|
11038
|
-
<summary>All
|
|
11185
|
+
<summary>All TypeScript definitions</summary>
|
|
11039
11186
|
|
|
11040
11187
|
```typescript
|
|
11041
11188
|
pick<T, K extends string | number | symbol>(propsToPick: K[], input: T): Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
|
|
@@ -11167,7 +11314,7 @@ test('with symbol', () => {
|
|
|
11167
11314
|
|
|
11168
11315
|
<details>
|
|
11169
11316
|
|
|
11170
|
-
<summary><strong>
|
|
11317
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11171
11318
|
|
|
11172
11319
|
```typescript
|
|
11173
11320
|
import {pick} from 'rambda'
|
|
@@ -11238,7 +11385,7 @@ Same as `R.pick` but it won't skip the missing props, i.e. it will assign them t
|
|
|
11238
11385
|
|
|
11239
11386
|
<details>
|
|
11240
11387
|
|
|
11241
|
-
<summary>All
|
|
11388
|
+
<summary>All TypeScript definitions</summary>
|
|
11242
11389
|
|
|
11243
11390
|
```typescript
|
|
11244
11391
|
pickAll<T, K extends keyof T>(propsToPicks: K[], input: T): Pick<T, K>;
|
|
@@ -11328,7 +11475,7 @@ test('with array as condition', () => {
|
|
|
11328
11475
|
|
|
11329
11476
|
<details>
|
|
11330
11477
|
|
|
11331
|
-
<summary><strong>
|
|
11478
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11332
11479
|
|
|
11333
11480
|
```typescript
|
|
11334
11481
|
import {pickAll} from 'rambda'
|
|
@@ -11409,7 +11556,7 @@ It returns list of the values of `property` taken from the all objects inside `l
|
|
|
11409
11556
|
|
|
11410
11557
|
<details>
|
|
11411
11558
|
|
|
11412
|
-
<summary>All
|
|
11559
|
+
<summary>All TypeScript definitions</summary>
|
|
11413
11560
|
|
|
11414
11561
|
```typescript
|
|
11415
11562
|
pluck<K extends keyof T, T>(property: K, list: T[]): T[K][];
|
|
@@ -11469,7 +11616,7 @@ test('with number', () => {
|
|
|
11469
11616
|
|
|
11470
11617
|
<details>
|
|
11471
11618
|
|
|
11472
|
-
<summary><strong>
|
|
11619
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11473
11620
|
|
|
11474
11621
|
```typescript
|
|
11475
11622
|
import {pluck} from 'rambda'
|
|
@@ -11521,7 +11668,7 @@ It adds element `x` at the beginning of `list`.
|
|
|
11521
11668
|
|
|
11522
11669
|
<details>
|
|
11523
11670
|
|
|
11524
|
-
<summary>All
|
|
11671
|
+
<summary>All TypeScript definitions</summary>
|
|
11525
11672
|
|
|
11526
11673
|
```typescript
|
|
11527
11674
|
prepend<T>(x: T, input: T[]): T[];
|
|
@@ -11575,7 +11722,7 @@ test('with string instead of array', () => {
|
|
|
11575
11722
|
|
|
11576
11723
|
<details>
|
|
11577
11724
|
|
|
11578
|
-
<summary><strong>
|
|
11725
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11579
11726
|
|
|
11580
11727
|
```typescript
|
|
11581
11728
|
import {prepend} from 'rambda'
|
|
@@ -11611,7 +11758,7 @@ product(list: number[]): number
|
|
|
11611
11758
|
|
|
11612
11759
|
<details>
|
|
11613
11760
|
|
|
11614
|
-
<summary>All
|
|
11761
|
+
<summary>All TypeScript definitions</summary>
|
|
11615
11762
|
|
|
11616
11763
|
```typescript
|
|
11617
11764
|
product(list: number[]): number;
|
|
@@ -11653,7 +11800,7 @@ test('bad input', () => {
|
|
|
11653
11800
|
|
|
11654
11801
|
<details>
|
|
11655
11802
|
|
|
11656
|
-
<summary><strong>
|
|
11803
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11657
11804
|
|
|
11658
11805
|
```typescript
|
|
11659
11806
|
import {product} from 'rambda'
|
|
@@ -11686,7 +11833,7 @@ If there is no such property, it returns `undefined`.
|
|
|
11686
11833
|
|
|
11687
11834
|
<details>
|
|
11688
11835
|
|
|
11689
|
-
<summary>All
|
|
11836
|
+
<summary>All TypeScript definitions</summary>
|
|
11690
11837
|
|
|
11691
11838
|
```typescript
|
|
11692
11839
|
prop<P extends keyof never, T>(propToFind: P, value: T): Prop<T, P>;
|
|
@@ -11740,7 +11887,7 @@ test('prop', () => {
|
|
|
11740
11887
|
|
|
11741
11888
|
<details>
|
|
11742
11889
|
|
|
11743
|
-
<summary><strong>
|
|
11890
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11744
11891
|
|
|
11745
11892
|
```typescript
|
|
11746
11893
|
import {prop} from 'rambda'
|
|
@@ -11803,7 +11950,7 @@ It returns true if `obj` has property `propToFind` and its value is equal to `va
|
|
|
11803
11950
|
|
|
11804
11951
|
<details>
|
|
11805
11952
|
|
|
11806
|
-
<summary>All
|
|
11953
|
+
<summary>All TypeScript definitions</summary>
|
|
11807
11954
|
|
|
11808
11955
|
```typescript
|
|
11809
11956
|
propEq<K extends string | number>(valueToMatch: any, propToFind: K, obj: Record<K, any>): boolean;
|
|
@@ -11870,7 +12017,7 @@ test('returns false if called with a null or undefined object', () => {
|
|
|
11870
12017
|
|
|
11871
12018
|
<details>
|
|
11872
12019
|
|
|
11873
|
-
<summary><strong>
|
|
12020
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11874
12021
|
|
|
11875
12022
|
```typescript
|
|
11876
12023
|
import {propEq} from 'rambda'
|
|
@@ -11937,7 +12084,7 @@ It returns `true` if `property` of `obj` is from `target` type.
|
|
|
11937
12084
|
|
|
11938
12085
|
<details>
|
|
11939
12086
|
|
|
11940
|
-
<summary>All
|
|
12087
|
+
<summary>All TypeScript definitions</summary>
|
|
11941
12088
|
|
|
11942
12089
|
```typescript
|
|
11943
12090
|
propIs<C extends AnyFunction, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, ReturnType<C>>;
|
|
@@ -12006,7 +12153,7 @@ test('when false', () => {
|
|
|
12006
12153
|
|
|
12007
12154
|
<details>
|
|
12008
12155
|
|
|
12009
|
-
<summary><strong>
|
|
12156
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12010
12157
|
|
|
12011
12158
|
```typescript
|
|
12012
12159
|
import {propIs} from 'rambda'
|
|
@@ -12044,7 +12191,7 @@ It returns either `defaultValue` or the value of `property` in `obj`.
|
|
|
12044
12191
|
|
|
12045
12192
|
<details>
|
|
12046
12193
|
|
|
12047
|
-
<summary>All
|
|
12194
|
+
<summary>All TypeScript definitions</summary>
|
|
12048
12195
|
|
|
12049
12196
|
```typescript
|
|
12050
12197
|
propOr<T, P extends string>(defaultValue: T, property: P, obj: Partial<Record<P, T>> | undefined): T;
|
|
@@ -12111,7 +12258,7 @@ test('propOr (currying)', () => {
|
|
|
12111
12258
|
|
|
12112
12259
|
<details>
|
|
12113
12260
|
|
|
12114
|
-
<summary><strong>
|
|
12261
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12115
12262
|
|
|
12116
12263
|
```typescript
|
|
12117
12264
|
import {propOr} from 'rambda'
|
|
@@ -12157,7 +12304,7 @@ It takes list with properties `propsToPick` and returns a list with property val
|
|
|
12157
12304
|
|
|
12158
12305
|
<details>
|
|
12159
12306
|
|
|
12160
|
-
<summary>All
|
|
12307
|
+
<summary>All TypeScript definitions</summary>
|
|
12161
12308
|
|
|
12162
12309
|
```typescript
|
|
12163
12310
|
props<P extends string, T>(propsToPick: P[], obj: Record<P, T>): T[];
|
|
@@ -12221,7 +12368,7 @@ test('wrong input', () => {
|
|
|
12221
12368
|
|
|
12222
12369
|
<details>
|
|
12223
12370
|
|
|
12224
|
-
<summary><strong>
|
|
12371
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12225
12372
|
|
|
12226
12373
|
```typescript
|
|
12227
12374
|
import {props} from 'rambda'
|
|
@@ -12259,7 +12406,7 @@ It returns `true` if the object property satisfies a given predicate.
|
|
|
12259
12406
|
|
|
12260
12407
|
<details>
|
|
12261
12408
|
|
|
12262
|
-
<summary>All
|
|
12409
|
+
<summary>All TypeScript definitions</summary>
|
|
12263
12410
|
|
|
12264
12411
|
```typescript
|
|
12265
12412
|
propSatisfies<T>(predicate: Predicate<T>, property: string, obj: Record<string, T>): boolean;
|
|
@@ -12311,7 +12458,7 @@ test('when false', () => {
|
|
|
12311
12458
|
|
|
12312
12459
|
<details>
|
|
12313
12460
|
|
|
12314
|
-
<summary><strong>
|
|
12461
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12315
12462
|
|
|
12316
12463
|
```typescript
|
|
12317
12464
|
import {propSatisfies} from 'rambda'
|
|
@@ -12349,7 +12496,7 @@ It returns list of numbers between `startInclusive` to `endExclusive` markers.
|
|
|
12349
12496
|
|
|
12350
12497
|
<details>
|
|
12351
12498
|
|
|
12352
|
-
<summary>All
|
|
12499
|
+
<summary>All TypeScript definitions</summary>
|
|
12353
12500
|
|
|
12354
12501
|
```typescript
|
|
12355
12502
|
range(startInclusive: number, endExclusive: number): number[];
|
|
@@ -12416,7 +12563,7 @@ test('curry', () => {
|
|
|
12416
12563
|
|
|
12417
12564
|
<details>
|
|
12418
12565
|
|
|
12419
|
-
<summary><strong>
|
|
12566
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12420
12567
|
|
|
12421
12568
|
```typescript
|
|
12422
12569
|
import {range} from 'rambda'
|
|
@@ -12458,7 +12605,7 @@ It has the opposite effect of `R.filter`.
|
|
|
12458
12605
|
|
|
12459
12606
|
<details>
|
|
12460
12607
|
|
|
12461
|
-
<summary>All
|
|
12608
|
+
<summary>All TypeScript definitions</summary>
|
|
12462
12609
|
|
|
12463
12610
|
```typescript
|
|
12464
12611
|
reject<T>(predicate: Predicate<T>, list: T[]): T[];
|
|
@@ -12516,7 +12663,7 @@ test('with object', () => {
|
|
|
12516
12663
|
|
|
12517
12664
|
<details>
|
|
12518
12665
|
|
|
12519
|
-
<summary><strong>
|
|
12666
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12520
12667
|
|
|
12521
12668
|
```typescript
|
|
12522
12669
|
import {reject} from 'rambda'
|
|
@@ -12577,7 +12724,7 @@ repeat<T>(x: T): (timesToRepeat: number) => T[]
|
|
|
12577
12724
|
|
|
12578
12725
|
<details>
|
|
12579
12726
|
|
|
12580
|
-
<summary>All
|
|
12727
|
+
<summary>All TypeScript definitions</summary>
|
|
12581
12728
|
|
|
12582
12729
|
```typescript
|
|
12583
12730
|
repeat<T>(x: T): (timesToRepeat: number) => T[];
|
|
@@ -12626,7 +12773,7 @@ test('repeat', () => {
|
|
|
12626
12773
|
|
|
12627
12774
|
<details>
|
|
12628
12775
|
|
|
12629
|
-
<summary><strong>
|
|
12776
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12630
12777
|
|
|
12631
12778
|
```typescript
|
|
12632
12779
|
import {repeat} from 'rambda'
|
|
@@ -12662,7 +12809,7 @@ It replaces `strOrRegex` found in `str` with `replacer`.
|
|
|
12662
12809
|
|
|
12663
12810
|
<details>
|
|
12664
12811
|
|
|
12665
|
-
<summary>All
|
|
12812
|
+
<summary>All TypeScript definitions</summary>
|
|
12666
12813
|
|
|
12667
12814
|
```typescript
|
|
12668
12815
|
replace(strOrRegex: RegExp | string, replacer: RegExpReplacer, str: string): string;
|
|
@@ -12724,7 +12871,7 @@ test('with function as replacer input', () => {
|
|
|
12724
12871
|
|
|
12725
12872
|
<details>
|
|
12726
12873
|
|
|
12727
|
-
<summary><strong>
|
|
12874
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12728
12875
|
|
|
12729
12876
|
```typescript
|
|
12730
12877
|
import {replace} from 'rambda'
|
|
@@ -12796,7 +12943,7 @@ It returns a reversed copy of list or string `input`.
|
|
|
12796
12943
|
|
|
12797
12944
|
<details>
|
|
12798
12945
|
|
|
12799
|
-
<summary>All
|
|
12946
|
+
<summary>All TypeScript definitions</summary>
|
|
12800
12947
|
|
|
12801
12948
|
```typescript
|
|
12802
12949
|
reverse<T>(input: T[]): T[];
|
|
@@ -12851,7 +12998,7 @@ test("it doesn't mutate", () => {
|
|
|
12851
12998
|
|
|
12852
12999
|
<details>
|
|
12853
13000
|
|
|
12854
|
-
<summary><strong>
|
|
13001
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12855
13002
|
|
|
12856
13003
|
```typescript
|
|
12857
13004
|
import {reverse} from 'rambda'
|
|
@@ -12883,7 +13030,7 @@ It returns a copied **Object** or **Array** with modified `lens` focus set to `r
|
|
|
12883
13030
|
|
|
12884
13031
|
<details>
|
|
12885
13032
|
|
|
12886
|
-
<summary>All
|
|
13033
|
+
<summary>All TypeScript definitions</summary>
|
|
12887
13034
|
|
|
12888
13035
|
```typescript
|
|
12889
13036
|
set<T, U>(lens: Lens, replacer: U, obj: T): T;
|
|
@@ -12977,7 +13124,7 @@ slice(from: number, to: number, input: string): string
|
|
|
12977
13124
|
|
|
12978
13125
|
<details>
|
|
12979
13126
|
|
|
12980
|
-
<summary>All
|
|
13127
|
+
<summary>All TypeScript definitions</summary>
|
|
12981
13128
|
|
|
12982
13129
|
```typescript
|
|
12983
13130
|
slice(from: number, to: number, input: string): string;
|
|
@@ -13042,7 +13189,7 @@ test('slice', () => {
|
|
|
13042
13189
|
|
|
13043
13190
|
<details>
|
|
13044
13191
|
|
|
13045
|
-
<summary><strong>
|
|
13192
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13046
13193
|
|
|
13047
13194
|
```typescript
|
|
13048
13195
|
import {slice} from 'rambda'
|
|
@@ -13078,7 +13225,7 @@ It returns copy of `list` sorted by `sortFn` function, where `sortFn` needs to r
|
|
|
13078
13225
|
|
|
13079
13226
|
<details>
|
|
13080
13227
|
|
|
13081
|
-
<summary>All
|
|
13228
|
+
<summary>All TypeScript definitions</summary>
|
|
13082
13229
|
|
|
13083
13230
|
```typescript
|
|
13084
13231
|
sort<T>(sortFn: (a: T, b: T) => number, list: T[]): T[];
|
|
@@ -13131,7 +13278,7 @@ test('it doesn\'t mutate', () => {
|
|
|
13131
13278
|
|
|
13132
13279
|
<details>
|
|
13133
13280
|
|
|
13134
|
-
<summary><strong>
|
|
13281
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13135
13282
|
|
|
13136
13283
|
```typescript
|
|
13137
13284
|
import {sort} from 'rambda'
|
|
@@ -13171,7 +13318,7 @@ It returns copy of `list` sorted by `sortFn` function, where `sortFn` function r
|
|
|
13171
13318
|
|
|
13172
13319
|
<details>
|
|
13173
13320
|
|
|
13174
|
-
<summary>All
|
|
13321
|
+
<summary>All TypeScript definitions</summary>
|
|
13175
13322
|
|
|
13176
13323
|
```typescript
|
|
13177
13324
|
sortBy<T>(sortFn: (a: T) => Ord, list: T[]): T[];
|
|
@@ -13248,7 +13395,7 @@ test('with compose', () => {
|
|
|
13248
13395
|
|
|
13249
13396
|
<details>
|
|
13250
13397
|
|
|
13251
|
-
<summary><strong>
|
|
13398
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13252
13399
|
|
|
13253
13400
|
```typescript
|
|
13254
13401
|
import {sortBy, pipe} from 'rambda'
|
|
@@ -13317,7 +13464,7 @@ Curried version of `String.prototype.split`
|
|
|
13317
13464
|
|
|
13318
13465
|
<details>
|
|
13319
13466
|
|
|
13320
|
-
<summary>All
|
|
13467
|
+
<summary>All TypeScript definitions</summary>
|
|
13321
13468
|
|
|
13322
13469
|
```typescript
|
|
13323
13470
|
split(separator: string | RegExp): (str: string) => string[];
|
|
@@ -13364,7 +13511,7 @@ test('curried', () => {
|
|
|
13364
13511
|
|
|
13365
13512
|
<details>
|
|
13366
13513
|
|
|
13367
|
-
<summary><strong>
|
|
13514
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13368
13515
|
|
|
13369
13516
|
```typescript
|
|
13370
13517
|
import {split} from 'rambda'
|
|
@@ -13403,7 +13550,7 @@ It splits string or array at a given index.
|
|
|
13403
13550
|
|
|
13404
13551
|
<details>
|
|
13405
13552
|
|
|
13406
|
-
<summary>All
|
|
13553
|
+
<summary>All TypeScript definitions</summary>
|
|
13407
13554
|
|
|
13408
13555
|
```typescript
|
|
13409
13556
|
splitAt<T>(index: number, input: T[]): [T[], T[]];
|
|
@@ -13516,7 +13663,7 @@ test('with bad inputs', () => {
|
|
|
13516
13663
|
|
|
13517
13664
|
<details>
|
|
13518
13665
|
|
|
13519
|
-
<summary><strong>
|
|
13666
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13520
13667
|
|
|
13521
13668
|
```typescript
|
|
13522
13669
|
import {splitAt} from 'rambda'
|
|
@@ -13569,7 +13716,7 @@ It splits `input` into slices of `sliceLength`.
|
|
|
13569
13716
|
|
|
13570
13717
|
<details>
|
|
13571
13718
|
|
|
13572
|
-
<summary>All
|
|
13719
|
+
<summary>All TypeScript definitions</summary>
|
|
13573
13720
|
|
|
13574
13721
|
```typescript
|
|
13575
13722
|
splitEvery<T>(sliceLength: number, input: T[]): (T[])[];
|
|
@@ -13636,7 +13783,7 @@ test('with bad input', () => {
|
|
|
13636
13783
|
|
|
13637
13784
|
<details>
|
|
13638
13785
|
|
|
13639
|
-
<summary><strong>
|
|
13786
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13640
13787
|
|
|
13641
13788
|
```typescript
|
|
13642
13789
|
import {splitEvery} from 'rambda'
|
|
@@ -13676,7 +13823,7 @@ The first array contains all members of `list` before `predicate` returns `true`
|
|
|
13676
13823
|
|
|
13677
13824
|
<details>
|
|
13678
13825
|
|
|
13679
|
-
<summary>All
|
|
13826
|
+
<summary>All TypeScript definitions</summary>
|
|
13680
13827
|
|
|
13681
13828
|
```typescript
|
|
13682
13829
|
splitWhen<T, U>(predicate: Predicate<T>, list: U[]): (U[])[];
|
|
@@ -13764,7 +13911,7 @@ test('with bad inputs', () => {
|
|
|
13764
13911
|
|
|
13765
13912
|
<details>
|
|
13766
13913
|
|
|
13767
|
-
<summary><strong>
|
|
13914
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13768
13915
|
|
|
13769
13916
|
```typescript
|
|
13770
13917
|
import {splitWhen} from 'rambda'
|
|
@@ -13804,7 +13951,7 @@ When iterable is a list, then it uses R.equals to determine if the target list s
|
|
|
13804
13951
|
|
|
13805
13952
|
<details>
|
|
13806
13953
|
|
|
13807
|
-
<summary>All
|
|
13954
|
+
<summary>All TypeScript definitions</summary>
|
|
13808
13955
|
|
|
13809
13956
|
```typescript
|
|
13810
13957
|
startsWith<T extends string>(question: T, input: string): boolean;
|
|
@@ -13898,7 +14045,7 @@ describe('brute force', () => {
|
|
|
13898
14045
|
|
|
13899
14046
|
<details>
|
|
13900
14047
|
|
|
13901
|
-
<summary><strong>
|
|
14048
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13902
14049
|
|
|
13903
14050
|
```typescript
|
|
13904
14051
|
import {startsWith} from 'rambda'
|
|
@@ -13953,7 +14100,7 @@ sum(list: number[]): number
|
|
|
13953
14100
|
|
|
13954
14101
|
<details>
|
|
13955
14102
|
|
|
13956
|
-
<summary>All
|
|
14103
|
+
<summary>All TypeScript definitions</summary>
|
|
13957
14104
|
|
|
13958
14105
|
```typescript
|
|
13959
14106
|
sum(list: number[]): number;
|
|
@@ -14004,7 +14151,7 @@ It returns a merged list of `x` and `y` with all equal elements removed.
|
|
|
14004
14151
|
|
|
14005
14152
|
<details>
|
|
14006
14153
|
|
|
14007
|
-
<summary>All
|
|
14154
|
+
<summary>All TypeScript definitions</summary>
|
|
14008
14155
|
|
|
14009
14156
|
```typescript
|
|
14010
14157
|
symmetricDifference<T>(x: T[], y: T[]): T[];
|
|
@@ -14065,7 +14212,7 @@ test('symmetricDifference with objects', () => {
|
|
|
14065
14212
|
|
|
14066
14213
|
<details>
|
|
14067
14214
|
|
|
14068
|
-
<summary><strong>
|
|
14215
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14069
14216
|
|
|
14070
14217
|
```typescript
|
|
14071
14218
|
import {symmetricDifference} from 'rambda'
|
|
@@ -14104,7 +14251,7 @@ T(): boolean
|
|
|
14104
14251
|
|
|
14105
14252
|
<details>
|
|
14106
14253
|
|
|
14107
|
-
<summary>All
|
|
14254
|
+
<summary>All TypeScript definitions</summary>
|
|
14108
14255
|
|
|
14109
14256
|
```typescript
|
|
14110
14257
|
T(): boolean;
|
|
@@ -14139,7 +14286,7 @@ It returns all but the first element of `input`.
|
|
|
14139
14286
|
|
|
14140
14287
|
<details>
|
|
14141
14288
|
|
|
14142
|
-
<summary>All
|
|
14289
|
+
<summary>All TypeScript definitions</summary>
|
|
14143
14290
|
|
|
14144
14291
|
```typescript
|
|
14145
14292
|
tail<T extends unknown[]>(input: T): T extends [any, ...infer U] ? U : [...T];
|
|
@@ -14186,7 +14333,7 @@ test('tail', () => {
|
|
|
14186
14333
|
|
|
14187
14334
|
<details>
|
|
14188
14335
|
|
|
14189
|
-
<summary><strong>
|
|
14336
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14190
14337
|
|
|
14191
14338
|
```typescript
|
|
14192
14339
|
import {tail} from 'rambda'
|
|
@@ -14227,7 +14374,7 @@ It returns the first `howMany` elements of `input`.
|
|
|
14227
14374
|
|
|
14228
14375
|
<details>
|
|
14229
14376
|
|
|
14230
|
-
<summary>All
|
|
14377
|
+
<summary>All TypeScript definitions</summary>
|
|
14231
14378
|
|
|
14232
14379
|
```typescript
|
|
14233
14380
|
take<T>(howMany: number, input: T[]): T[];
|
|
@@ -14295,7 +14442,7 @@ test('with zero index', () => {
|
|
|
14295
14442
|
|
|
14296
14443
|
<details>
|
|
14297
14444
|
|
|
14298
|
-
<summary><strong>
|
|
14445
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14299
14446
|
|
|
14300
14447
|
```typescript
|
|
14301
14448
|
import {take} from 'rambda'
|
|
@@ -14348,7 +14495,7 @@ It returns the last `howMany` elements of `input`.
|
|
|
14348
14495
|
|
|
14349
14496
|
<details>
|
|
14350
14497
|
|
|
14351
|
-
<summary>All
|
|
14498
|
+
<summary>All TypeScript definitions</summary>
|
|
14352
14499
|
|
|
14353
14500
|
```typescript
|
|
14354
14501
|
takeLast<T>(howMany: number, input: T[]): T[];
|
|
@@ -14424,7 +14571,7 @@ test('with negative index', () => {
|
|
|
14424
14571
|
|
|
14425
14572
|
<details>
|
|
14426
14573
|
|
|
14427
|
-
<summary><strong>
|
|
14574
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14428
14575
|
|
|
14429
14576
|
```typescript
|
|
14430
14577
|
import {takeLast} from 'rambda'
|
|
@@ -14475,7 +14622,7 @@ takeLastWhile(predicate: (x: string) => boolean, input: string): string
|
|
|
14475
14622
|
|
|
14476
14623
|
<details>
|
|
14477
14624
|
|
|
14478
|
-
<summary>All
|
|
14625
|
+
<summary>All TypeScript definitions</summary>
|
|
14479
14626
|
|
|
14480
14627
|
```typescript
|
|
14481
14628
|
takeLastWhile(predicate: (x: string) => boolean, input: string): string;
|
|
@@ -14554,7 +14701,7 @@ test('with string', () => {
|
|
|
14554
14701
|
|
|
14555
14702
|
<details>
|
|
14556
14703
|
|
|
14557
|
-
<summary><strong>
|
|
14704
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14558
14705
|
|
|
14559
14706
|
```typescript
|
|
14560
14707
|
import {takeLastWhile} from 'rambda'
|
|
@@ -14611,7 +14758,7 @@ One use case is debugging in the middle of `R.compose`.
|
|
|
14611
14758
|
|
|
14612
14759
|
<details>
|
|
14613
14760
|
|
|
14614
|
-
<summary>All
|
|
14761
|
+
<summary>All TypeScript definitions</summary>
|
|
14615
14762
|
|
|
14616
14763
|
```typescript
|
|
14617
14764
|
tap<T>(fn: (x: T) => void, input: T): T;
|
|
@@ -14657,7 +14804,7 @@ test('tap', () => {
|
|
|
14657
14804
|
|
|
14658
14805
|
<details>
|
|
14659
14806
|
|
|
14660
|
-
<summary><strong>
|
|
14807
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14661
14808
|
|
|
14662
14809
|
```typescript
|
|
14663
14810
|
import {tap, pipe} from 'rambda'
|
|
@@ -14691,7 +14838,7 @@ It determines whether `str` matches `regExpression`.
|
|
|
14691
14838
|
|
|
14692
14839
|
<details>
|
|
14693
14840
|
|
|
14694
|
-
<summary>All
|
|
14841
|
+
<summary>All TypeScript definitions</summary>
|
|
14695
14842
|
|
|
14696
14843
|
```typescript
|
|
14697
14844
|
test(regExpression: RegExp): (str: string) => boolean;
|
|
@@ -14740,7 +14887,7 @@ test('throws if first argument is not regex', () => {
|
|
|
14740
14887
|
|
|
14741
14888
|
<details>
|
|
14742
14889
|
|
|
14743
|
-
<summary><strong>
|
|
14890
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14744
14891
|
|
|
14745
14892
|
```typescript
|
|
14746
14893
|
import {test} from 'rambda'
|
|
@@ -14781,7 +14928,7 @@ The range array includes numbers between `0` and `howMany`(exclusive).
|
|
|
14781
14928
|
|
|
14782
14929
|
<details>
|
|
14783
14930
|
|
|
14784
|
-
<summary>All
|
|
14931
|
+
<summary>All TypeScript definitions</summary>
|
|
14785
14932
|
|
|
14786
14933
|
```typescript
|
|
14787
14934
|
times<T>(fn: (i: number) => T, howMany: number): T[];
|
|
@@ -14847,7 +14994,7 @@ test('curry', () => {
|
|
|
14847
14994
|
|
|
14848
14995
|
<details>
|
|
14849
14996
|
|
|
14850
|
-
<summary><strong>
|
|
14997
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14851
14998
|
|
|
14852
14999
|
```typescript
|
|
14853
15000
|
import {times, identity} from 'rambda'
|
|
@@ -14875,7 +15022,7 @@ toLower<S extends string>(str: S): Lowercase<S>
|
|
|
14875
15022
|
|
|
14876
15023
|
<details>
|
|
14877
15024
|
|
|
14878
|
-
<summary>All
|
|
15025
|
+
<summary>All TypeScript definitions</summary>
|
|
14879
15026
|
|
|
14880
15027
|
```typescript
|
|
14881
15028
|
toLower<S extends string>(str: S): Lowercase<S>;
|
|
@@ -14925,7 +15072,7 @@ It transforms an object to a list.
|
|
|
14925
15072
|
|
|
14926
15073
|
<details>
|
|
14927
15074
|
|
|
14928
|
-
<summary>All
|
|
15075
|
+
<summary>All TypeScript definitions</summary>
|
|
14929
15076
|
|
|
14930
15077
|
```typescript
|
|
14931
15078
|
toPairs<O extends object, K extends Extract<keyof O, string | number>>(obj: O): Array<{ [key in K]: [`${key}`, O[key]] }[K]>;
|
|
@@ -14973,7 +15120,7 @@ test('happy', () => {
|
|
|
14973
15120
|
|
|
14974
15121
|
<details>
|
|
14975
15122
|
|
|
14976
|
-
<summary><strong>
|
|
15123
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14977
15124
|
|
|
14978
15125
|
```typescript
|
|
14979
15126
|
import {toPairs} from 'rambda'
|
|
@@ -15008,7 +15155,7 @@ toString(x: unknown): string
|
|
|
15008
15155
|
|
|
15009
15156
|
<details>
|
|
15010
15157
|
|
|
15011
|
-
<summary>All
|
|
15158
|
+
<summary>All TypeScript definitions</summary>
|
|
15012
15159
|
|
|
15013
15160
|
```typescript
|
|
15014
15161
|
toString(x: unknown): string;
|
|
@@ -15055,7 +15202,7 @@ toUpper<S extends string>(str: S): Uppercase<S>
|
|
|
15055
15202
|
|
|
15056
15203
|
<details>
|
|
15057
15204
|
|
|
15058
|
-
<summary>All
|
|
15205
|
+
<summary>All TypeScript definitions</summary>
|
|
15059
15206
|
|
|
15060
15207
|
```typescript
|
|
15061
15208
|
toUpper<S extends string>(str: S): Uppercase<S>;
|
|
@@ -15103,7 +15250,7 @@ transpose<T>(list: (T[])[]): (T[])[]
|
|
|
15103
15250
|
|
|
15104
15251
|
<details>
|
|
15105
15252
|
|
|
15106
|
-
<summary>All
|
|
15253
|
+
<summary>All TypeScript definitions</summary>
|
|
15107
15254
|
|
|
15108
15255
|
```typescript
|
|
15109
15256
|
transpose<T>(list: (T[])[]): (T[])[];
|
|
@@ -15179,7 +15326,7 @@ test('array with falsy values', () => {
|
|
|
15179
15326
|
|
|
15180
15327
|
<details>
|
|
15181
15328
|
|
|
15182
|
-
<summary><strong>
|
|
15329
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15183
15330
|
|
|
15184
15331
|
```typescript
|
|
15185
15332
|
import {transpose} from 'rambda'
|
|
@@ -15214,7 +15361,7 @@ trim(str: string): string
|
|
|
15214
15361
|
|
|
15215
15362
|
<details>
|
|
15216
15363
|
|
|
15217
|
-
<summary>All
|
|
15364
|
+
<summary>All TypeScript definitions</summary>
|
|
15218
15365
|
|
|
15219
15366
|
```typescript
|
|
15220
15367
|
trim(str: string): string;
|
|
@@ -15281,7 +15428,7 @@ It calls a function `fn` with the list of values of the returned function.
|
|
|
15281
15428
|
|
|
15282
15429
|
<details>
|
|
15283
15430
|
|
|
15284
|
-
<summary>All
|
|
15431
|
+
<summary>All TypeScript definitions</summary>
|
|
15285
15432
|
|
|
15286
15433
|
```typescript
|
|
15287
15434
|
unapply<T = any>(fn: (args: any[]) => T): (...args: any[]) => T;
|
|
@@ -15404,7 +15551,7 @@ test('it works with converge', () => {
|
|
|
15404
15551
|
|
|
15405
15552
|
<details>
|
|
15406
15553
|
|
|
15407
|
-
<summary><strong>
|
|
15554
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15408
15555
|
|
|
15409
15556
|
```typescript
|
|
15410
15557
|
import {join, unapply, sum} from 'rambda'
|
|
@@ -15443,7 +15590,7 @@ It takes two lists and return a new list containing a merger of both list with r
|
|
|
15443
15590
|
|
|
15444
15591
|
<details>
|
|
15445
15592
|
|
|
15446
|
-
<summary>All
|
|
15593
|
+
<summary>All TypeScript definitions</summary>
|
|
15447
15594
|
|
|
15448
15595
|
```typescript
|
|
15449
15596
|
union<T>(x: T[], y: T[]): T[];
|
|
@@ -15497,7 +15644,7 @@ test('with list of objects', () => {
|
|
|
15497
15644
|
|
|
15498
15645
|
<details>
|
|
15499
15646
|
|
|
15500
|
-
<summary><strong>
|
|
15647
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15501
15648
|
|
|
15502
15649
|
```typescript
|
|
15503
15650
|
import {union} from 'rambda'
|
|
@@ -15564,7 +15711,7 @@ It returns a new array containing only one copy of each element of `list`.
|
|
|
15564
15711
|
|
|
15565
15712
|
<details>
|
|
15566
15713
|
|
|
15567
|
-
<summary>All
|
|
15714
|
+
<summary>All TypeScript definitions</summary>
|
|
15568
15715
|
|
|
15569
15716
|
```typescript
|
|
15570
15717
|
uniq<T>(list: T[]): T[];
|
|
@@ -15632,7 +15779,7 @@ test('can distinct between string and number', () => {
|
|
|
15632
15779
|
|
|
15633
15780
|
<details>
|
|
15634
15781
|
|
|
15635
|
-
<summary><strong>
|
|
15782
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15636
15783
|
|
|
15637
15784
|
```typescript
|
|
15638
15785
|
import {uniq} from 'rambda'
|
|
@@ -15674,7 +15821,7 @@ This predicate should return true, if two elements are equal.
|
|
|
15674
15821
|
|
|
15675
15822
|
<details>
|
|
15676
15823
|
|
|
15677
|
-
<summary>All
|
|
15824
|
+
<summary>All TypeScript definitions</summary>
|
|
15678
15825
|
|
|
15679
15826
|
```typescript
|
|
15680
15827
|
uniqWith<T, U>(predicate: (x: T, y: T) => boolean, list: T[]): T[];
|
|
@@ -15759,7 +15906,7 @@ test('with list of strings', () => {
|
|
|
15759
15906
|
|
|
15760
15907
|
<details>
|
|
15761
15908
|
|
|
15762
|
-
<summary><strong>
|
|
15909
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15763
15910
|
|
|
15764
15911
|
```typescript
|
|
15765
15912
|
import {uniqWith} from 'rambda'
|
|
@@ -15797,7 +15944,7 @@ In the other case, the final output will be the `input` itself.
|
|
|
15797
15944
|
|
|
15798
15945
|
<details>
|
|
15799
15946
|
|
|
15800
|
-
<summary>All
|
|
15947
|
+
<summary>All TypeScript definitions</summary>
|
|
15801
15948
|
|
|
15802
15949
|
```typescript
|
|
15803
15950
|
unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U, x: T): T | U;
|
|
@@ -15849,7 +15996,7 @@ test('curried', () => {
|
|
|
15849
15996
|
|
|
15850
15997
|
<details>
|
|
15851
15998
|
|
|
15852
|
-
<summary><strong>
|
|
15999
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15853
16000
|
|
|
15854
16001
|
```typescript
|
|
15855
16002
|
import {unless, inc} from 'rambda'
|
|
@@ -15954,7 +16101,7 @@ It returns a copy of `list` with updated element at `index` with `newValue`.
|
|
|
15954
16101
|
|
|
15955
16102
|
<details>
|
|
15956
16103
|
|
|
15957
|
-
<summary>All
|
|
16104
|
+
<summary>All TypeScript definitions</summary>
|
|
15958
16105
|
|
|
15959
16106
|
```typescript
|
|
15960
16107
|
update<T>(index: number, newValue: T, list: T[]): T[];
|
|
@@ -16044,7 +16191,7 @@ test('with negative index', () => {
|
|
|
16044
16191
|
|
|
16045
16192
|
<details>
|
|
16046
16193
|
|
|
16047
|
-
<summary><strong>
|
|
16194
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16048
16195
|
|
|
16049
16196
|
```typescript
|
|
16050
16197
|
import {update} from 'rambda'
|
|
@@ -16074,7 +16221,7 @@ With correct input, this is nothing more than `Object.values(Record<string, unkn
|
|
|
16074
16221
|
|
|
16075
16222
|
<details>
|
|
16076
16223
|
|
|
16077
|
-
<summary>All
|
|
16224
|
+
<summary>All TypeScript definitions</summary>
|
|
16078
16225
|
|
|
16079
16226
|
```typescript
|
|
16080
16227
|
values<T extends object, K extends keyof T>(obj: T): T[K][];
|
|
@@ -16130,7 +16277,7 @@ test('with bad input', () => {
|
|
|
16130
16277
|
|
|
16131
16278
|
<details>
|
|
16132
16279
|
|
|
16133
|
-
<summary><strong>
|
|
16280
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16134
16281
|
|
|
16135
16282
|
```typescript
|
|
16136
16283
|
import {values} from 'rambda'
|
|
@@ -16164,7 +16311,7 @@ It returns the value of `lens` focus over `target` object.
|
|
|
16164
16311
|
|
|
16165
16312
|
<details>
|
|
16166
16313
|
|
|
16167
|
-
<summary>All
|
|
16314
|
+
<summary>All TypeScript definitions</summary>
|
|
16168
16315
|
|
|
16169
16316
|
```typescript
|
|
16170
16317
|
view<T, U>(lens: Lens): (target: T) => U;
|
|
@@ -16214,7 +16361,7 @@ test('happy', () => {
|
|
|
16214
16361
|
|
|
16215
16362
|
<details>
|
|
16216
16363
|
|
|
16217
|
-
<summary><strong>
|
|
16364
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16218
16365
|
|
|
16219
16366
|
```typescript
|
|
16220
16367
|
import {lens, view, assoc} from 'rambda'
|
|
@@ -16252,7 +16399,7 @@ when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U, input: T): T |
|
|
|
16252
16399
|
|
|
16253
16400
|
<details>
|
|
16254
16401
|
|
|
16255
|
-
<summary>All
|
|
16402
|
+
<summary>All TypeScript definitions</summary>
|
|
16256
16403
|
|
|
16257
16404
|
```typescript
|
|
16258
16405
|
when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U, input: T): T | U;
|
|
@@ -16303,7 +16450,7 @@ test('happy', () => {
|
|
|
16303
16450
|
|
|
16304
16451
|
<details>
|
|
16305
16452
|
|
|
16306
|
-
<summary><strong>
|
|
16453
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16307
16454
|
|
|
16308
16455
|
```typescript
|
|
16309
16456
|
import {when} from 'rambda'
|
|
@@ -16348,7 +16495,7 @@ It returns `true` if all each property in `conditions` returns `true` when appli
|
|
|
16348
16495
|
|
|
16349
16496
|
<details>
|
|
16350
16497
|
|
|
16351
|
-
<summary>All
|
|
16498
|
+
<summary>All TypeScript definitions</summary>
|
|
16352
16499
|
|
|
16353
16500
|
```typescript
|
|
16354
16501
|
where<T, U>(conditions: T, input: U): boolean;
|
|
@@ -16430,7 +16577,7 @@ test('when false | early exit', () => {
|
|
|
16430
16577
|
|
|
16431
16578
|
<details>
|
|
16432
16579
|
|
|
16433
|
-
<summary><strong>
|
|
16580
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16434
16581
|
|
|
16435
16582
|
```typescript
|
|
16436
16583
|
import {where, equals} from 'rambda'
|
|
@@ -16482,7 +16629,7 @@ It will return `true` if all of `input` object fully or partially include `rule`
|
|
|
16482
16629
|
|
|
16483
16630
|
<details>
|
|
16484
16631
|
|
|
16485
|
-
<summary>All
|
|
16632
|
+
<summary>All TypeScript definitions</summary>
|
|
16486
16633
|
|
|
16487
16634
|
```typescript
|
|
16488
16635
|
whereEq<T, U>(condition: T, input: U): boolean;
|
|
@@ -16568,7 +16715,7 @@ test('with wrong input', () => {
|
|
|
16568
16715
|
|
|
16569
16716
|
<details>
|
|
16570
16717
|
|
|
16571
|
-
<summary><strong>
|
|
16718
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16572
16719
|
|
|
16573
16720
|
```typescript
|
|
16574
16721
|
import {whereEq} from 'rambda'
|
|
@@ -16602,7 +16749,7 @@ It will return a new array, based on all members of `source` list that are not p
|
|
|
16602
16749
|
|
|
16603
16750
|
<details>
|
|
16604
16751
|
|
|
16605
|
-
<summary>All
|
|
16752
|
+
<summary>All TypeScript definitions</summary>
|
|
16606
16753
|
|
|
16607
16754
|
```typescript
|
|
16608
16755
|
without<T>(matchAgainst: T[], source: T[]): T[];
|
|
@@ -16677,7 +16824,7 @@ test('ramda test', () => {
|
|
|
16677
16824
|
|
|
16678
16825
|
<details>
|
|
16679
16826
|
|
|
16680
|
-
<summary><strong>
|
|
16827
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16681
16828
|
|
|
16682
16829
|
```typescript
|
|
16683
16830
|
import {without} from 'rambda'
|
|
@@ -16716,7 +16863,7 @@ Logical XOR
|
|
|
16716
16863
|
|
|
16717
16864
|
<details>
|
|
16718
16865
|
|
|
16719
|
-
<summary>All
|
|
16866
|
+
<summary>All TypeScript definitions</summary>
|
|
16720
16867
|
|
|
16721
16868
|
```typescript
|
|
16722
16869
|
xor(x: boolean, y: boolean): boolean;
|
|
@@ -16795,7 +16942,7 @@ test('when one argument is truthy and the other is falsy, it should return true'
|
|
|
16795
16942
|
|
|
16796
16943
|
<details>
|
|
16797
16944
|
|
|
16798
|
-
<summary><strong>
|
|
16945
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16799
16946
|
|
|
16800
16947
|
```typescript
|
|
16801
16948
|
import {xor} from 'rambda'
|
|
@@ -16829,7 +16976,7 @@ The returned list will be truncated to match the length of the shortest supplied
|
|
|
16829
16976
|
|
|
16830
16977
|
<details>
|
|
16831
16978
|
|
|
16832
|
-
<summary>All
|
|
16979
|
+
<summary>All TypeScript definitions</summary>
|
|
16833
16980
|
|
|
16834
16981
|
```typescript
|
|
16835
16982
|
zip<K, V>(x: K[], y: V[]): KeyValuePair<K, V>[];
|
|
@@ -16905,7 +17052,7 @@ test('should truncate result to length of shorted input list', () => {
|
|
|
16905
17052
|
|
|
16906
17053
|
<details>
|
|
16907
17054
|
|
|
16908
|
-
<summary><strong>
|
|
17055
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16909
17056
|
|
|
16910
17057
|
```typescript
|
|
16911
17058
|
import {zip} from 'rambda'
|
|
@@ -16938,7 +17085,7 @@ It will return a new object with keys of `keys` array and values of `values` arr
|
|
|
16938
17085
|
|
|
16939
17086
|
<details>
|
|
16940
17087
|
|
|
16941
|
-
<summary>All
|
|
17088
|
+
<summary>All TypeScript definitions</summary>
|
|
16942
17089
|
|
|
16943
17090
|
```typescript
|
|
16944
17091
|
zipObj<T, K extends string>(keys: K[], values: T[]): { [P in K]: T };
|
|
@@ -17017,7 +17164,7 @@ test('ignore extra keys', () => {
|
|
|
17017
17164
|
|
|
17018
17165
|
<details>
|
|
17019
17166
|
|
|
17020
|
-
<summary><strong>
|
|
17167
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
17021
17168
|
|
|
17022
17169
|
```typescript
|
|
17023
17170
|
import {zipObj} from 'rambda'
|
|
@@ -17052,7 +17199,7 @@ zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: T[], list2: U[]): TRe
|
|
|
17052
17199
|
|
|
17053
17200
|
<details>
|
|
17054
17201
|
|
|
17055
|
-
<summary>All
|
|
17202
|
+
<summary>All TypeScript definitions</summary>
|
|
17056
17203
|
|
|
17057
17204
|
```typescript
|
|
17058
17205
|
zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: T[], list2: U[]): TResult[];
|
|
@@ -17112,7 +17259,7 @@ test('when second list is longer', () => {
|
|
|
17112
17259
|
|
|
17113
17260
|
<details>
|
|
17114
17261
|
|
|
17115
|
-
<summary><strong>
|
|
17262
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
17116
17263
|
|
|
17117
17264
|
```typescript
|
|
17118
17265
|
import {zipWith} from 'rambda'
|
|
@@ -17152,9 +17299,21 @@ describe('R.zipWith', () => {
|
|
|
17152
17299
|
|
|
17153
17300
|
## ❯ CHANGELOG
|
|
17154
17301
|
|
|
17302
|
+
8.2.0
|
|
17303
|
+
|
|
17304
|
+
Add the following methods:
|
|
17305
|
+
|
|
17306
|
+
- addIndex
|
|
17307
|
+
- addIndexRight
|
|
17308
|
+
- ap
|
|
17309
|
+
- aperture
|
|
17310
|
+
- applyTo
|
|
17311
|
+
- ascend
|
|
17312
|
+
- descend
|
|
17313
|
+
|
|
17155
17314
|
8.1.0
|
|
17156
17315
|
|
|
17157
|
-
- Fix input order of TS definitions for `R.propEq` method - [Issue #688](https://github.com/selfrefactor/rambda/issues/688)
|
|
17316
|
+
- Fix input order of TS definitions for `R.propEq` method - [Issue #688](https://github.com/selfrefactor/rambda/issues/688). The issue was due to 8.0.0 was shipped with TS definitions of `7.5.0` release.
|
|
17158
17317
|
|
|
17159
17318
|
- Add `R.differenceWith` method - [Issue #91](https://github.com/selfrefactor/rambdax/issues/91)
|
|
17160
17319
|
|
|
@@ -17172,7 +17331,7 @@ describe('R.zipWith', () => {
|
|
|
17172
17331
|
|
|
17173
17332
|
- `R.nop` is removed - it will be moved to `Rambdax` as `R.noop`
|
|
17174
17333
|
|
|
17175
|
-
- `R.includes` is no longer using string literal in
|
|
17334
|
+
- `R.includes` is no longer using string literal in TypeScript definitions
|
|
17176
17335
|
|
|
17177
17336
|
> Reason for breaking change - synchronize with Ramda `0.29.0` release:
|
|
17178
17337
|
|
|
@@ -17202,7 +17361,7 @@ describe('R.zipWith', () => {
|
|
|
17202
17361
|
|
|
17203
17362
|
- Add `R.modify`
|
|
17204
17363
|
|
|
17205
|
-
- Allow multiple inputs in
|
|
17364
|
+
- Allow multiple inputs in TypeScript versions of `R.anyPass` and `R.allPass` - [Issue #642](https://github.com/selfrefactor/rambda/issues/604)
|
|
17206
17365
|
|
|
17207
17366
|
- Using wrong clone of object in `R.mergeDeepRight` - [Issue #650](https://github.com/selfrefactor/rambda/issues/650)
|
|
17208
17367
|
|
|
@@ -17212,7 +17371,7 @@ describe('R.zipWith', () => {
|
|
|
17212
17371
|
|
|
17213
17372
|
7.2.1
|
|
17214
17373
|
|
|
17215
|
-
- Remove bad typings of `R.propIs` which caused the library to cannot be build with
|
|
17374
|
+
- Remove bad typings of `R.propIs` which caused the library to cannot be build with TypeScript.
|
|
17216
17375
|
|
|
17217
17376
|
- Drop support for `Wallaby` as per [https://github.com/wallabyjs/public/issues/3037](https://github.com/wallabyjs/public/issues/3037)
|
|
17218
17377
|
|
|
@@ -17246,7 +17405,7 @@ describe('R.zipWith', () => {
|
|
|
17246
17405
|
|
|
17247
17406
|
- Replace `Async` with `Promise` as return type of `R.type`.
|
|
17248
17407
|
|
|
17249
|
-
- Add new types as
|
|
17408
|
+
- Add new types as TypeScript output for `R.type` - "Map", "WeakMap", "Generator", "GeneratorFunction", "BigInt", "ArrayBuffer"
|
|
17250
17409
|
|
|
17251
17410
|
- Add `R.juxt` method
|
|
17252
17411
|
|
|
@@ -17274,7 +17433,7 @@ Rambda doesn't work with `pnpm` due to wrong export configuration - [Issue #619]
|
|
|
17274
17433
|
|
|
17275
17434
|
7.0.0
|
|
17276
17435
|
|
|
17277
|
-
- Breaking change - sync `R.compose`/`R.pipe` with `@types/ramda`. That is significant change so as safeguard, it will lead a major bump. Important - this lead to raising required
|
|
17436
|
+
- Breaking change - sync `R.compose`/`R.pipe` with `@types/ramda`. That is significant change so as safeguard, it will lead a major bump. Important - this lead to raising required TypeScript version to `4.2.2`. In other words, to use `Rambda` you'll need TypeScript version `4.2.2` or newer.
|
|
17278
17437
|
|
|
17279
17438
|
Related commit in `@types/ramda` - https://github.com/DefinitelyTyped/DefinitelyTyped/commit/286eff4f76d41eb8f091e7437eabd8a60d97fc1f#diff-4f74803fa83a81e47cb17a7d8a4e46a7e451f4d9e5ce2f1bd7a70a72d91f4bc1
|
|
17280
17439
|
|
|
@@ -17357,7 +17516,7 @@ Fixing `R.uniq` was done by improving `R.indexOf` which has performance implicat
|
|
|
17357
17516
|
|
|
17358
17517
|
6.8.3
|
|
17359
17518
|
|
|
17360
|
-
- Fix
|
|
17519
|
+
- Fix TypeScript build process with `rambda/immutable` - [Issue #572](https://github.com/selfrefactor/rambda/issues/572)
|
|
17361
17520
|
|
|
17362
17521
|
- Add `R.objOf` method
|
|
17363
17522
|
|
|
@@ -17377,7 +17536,7 @@ Fixing `R.uniq` was done by improving `R.indexOf` which has performance implicat
|
|
|
17377
17536
|
|
|
17378
17537
|
6.7.0
|
|
17379
17538
|
|
|
17380
|
-
- Remove `ts-toolbelt` types from
|
|
17539
|
+
- Remove `ts-toolbelt` types from TypeScript definitions. Most affected are the following methods, which lose one of its curried definitions:
|
|
17381
17540
|
|
|
17382
17541
|
1. R.maxBy
|
|
17383
17542
|
2. R.minBy
|
|
@@ -17501,7 +17660,7 @@ Fix wrong versions in changelog
|
|
|
17501
17660
|
</td>
|
|
17502
17661
|
<td width="20%" align="center">
|
|
17503
17662
|
<h4>Useful Javascript libraries</h4>
|
|
17504
|
-
<a href="https://github.com/selfrefactor/useful-javascript-libraries">Large collection of JavaScript,
|
|
17663
|
+
<a href="https://github.com/selfrefactor/useful-javascript-libraries">Large collection of JavaScript,TypeScript and Angular related repos links</a>
|
|
17505
17664
|
</td>
|
|
17506
17665
|
<td width="20%" align="center">
|
|
17507
17666
|
<h4>Run-fn</h4>
|