rambda 8.1.0 → 8.3.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 +44 -22
- package/README.md +467 -290
- package/dist/rambda.js +255 -152
- package/dist/rambda.umd.js +1 -1
- package/immutable.d.ts +52 -11
- package/index.d.ts +52 -11
- package/package.json +25 -24
- package/rambda.js +12 -0
- package/src/_internals/_arity.js +64 -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/binary.js +5 -0
- package/src/call.js +1 -0
- package/src/collectBy.js +27 -0
- package/src/comparator.js +5 -0
- package/src/composeWith.js +33 -0
- package/src/curryN.js +2 -65
- package/src/descend.js +17 -0
- package/src/pipe.js +1 -67
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,24 +96,12 @@ 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 67 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
|
-
- binary
|
|
110
|
-
- call
|
|
111
|
-
- collectBy
|
|
112
|
-
- comparator
|
|
113
|
-
- composeWith
|
|
114
103
|
- construct
|
|
115
104
|
- constructN
|
|
116
|
-
- descend
|
|
117
105
|
- dissocPath
|
|
118
106
|
- dropRepeatsBy
|
|
119
107
|
- empty
|
|
@@ -219,7 +207,7 @@ import {compose, add} from 'https://raw.githubusercontent.com/selfrefactor/rambd
|
|
|
219
207
|
|
|
220
208
|
- 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
209
|
|
|
222
|
-
-
|
|
210
|
+
- TypeScript definitions between `rambda` and `@types/ramda` may vary.
|
|
223
211
|
|
|
224
212
|
> 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
213
|
|
|
@@ -340,6 +328,14 @@ It adds `a` and `b`.
|
|
|
340
328
|
|
|
341
329
|
[](#add)
|
|
342
330
|
|
|
331
|
+
### addIndex
|
|
332
|
+
|
|
333
|
+
[](#addIndex)
|
|
334
|
+
|
|
335
|
+
### addIndexRight
|
|
336
|
+
|
|
337
|
+
[](#addIndexRight)
|
|
338
|
+
|
|
343
339
|
### adjust
|
|
344
340
|
|
|
345
341
|
```typescript
|
|
@@ -353,7 +349,7 @@ It replaces `index` in array `list` with the result of `replaceFn(list[i])`.
|
|
|
353
349
|
|
|
354
350
|
<details>
|
|
355
351
|
|
|
356
|
-
<summary>All
|
|
352
|
+
<summary>All TypeScript definitions</summary>
|
|
357
353
|
|
|
358
354
|
```typescript
|
|
359
355
|
adjust<T>(index: number, replaceFn: (x: T) => T, list: T[]): T[];
|
|
@@ -453,7 +449,7 @@ It returns `true`, if all members of array `list` returns `true`, when applied a
|
|
|
453
449
|
|
|
454
450
|
<details>
|
|
455
451
|
|
|
456
|
-
<summary>All
|
|
452
|
+
<summary>All TypeScript definitions</summary>
|
|
457
453
|
|
|
458
454
|
```typescript
|
|
459
455
|
all<T>(predicate: (x: T) => boolean, list: T[]): boolean;
|
|
@@ -506,7 +502,7 @@ test('when false', () => {
|
|
|
506
502
|
|
|
507
503
|
<details>
|
|
508
504
|
|
|
509
|
-
<summary><strong>
|
|
505
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
510
506
|
|
|
511
507
|
```typescript
|
|
512
508
|
import {all} from 'rambda'
|
|
@@ -549,7 +545,7 @@ It returns `true`, if all functions of `predicates` return `true`, when `input`
|
|
|
549
545
|
|
|
550
546
|
<details>
|
|
551
547
|
|
|
552
|
-
<summary>All
|
|
548
|
+
<summary>All TypeScript definitions</summary>
|
|
553
549
|
|
|
554
550
|
```typescript
|
|
555
551
|
allPass<T>(predicates: ((x: T) => boolean)[]): (input: T) => boolean;
|
|
@@ -629,7 +625,7 @@ test('works with multiple inputs', () => {
|
|
|
629
625
|
|
|
630
626
|
<details>
|
|
631
627
|
|
|
632
|
-
<summary><strong>
|
|
628
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
633
629
|
|
|
634
630
|
```typescript
|
|
635
631
|
import {allPass, filter} from 'rambda'
|
|
@@ -702,7 +698,7 @@ It returns `true`, if at least one member of `list` returns true, when passed to
|
|
|
702
698
|
|
|
703
699
|
<details>
|
|
704
700
|
|
|
705
|
-
<summary>All
|
|
701
|
+
<summary>All TypeScript definitions</summary>
|
|
706
702
|
|
|
707
703
|
```typescript
|
|
708
704
|
any<T>(predicate: (x: T) => boolean, list: T[]): boolean;
|
|
@@ -755,7 +751,7 @@ test('with curry', () => {
|
|
|
755
751
|
|
|
756
752
|
<details>
|
|
757
753
|
|
|
758
|
-
<summary><strong>
|
|
754
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
759
755
|
|
|
760
756
|
```typescript
|
|
761
757
|
import {any} from 'rambda'
|
|
@@ -799,7 +795,7 @@ It accepts list of `predicates` and returns a function. This function with its `
|
|
|
799
795
|
|
|
800
796
|
<details>
|
|
801
797
|
|
|
802
|
-
<summary>All
|
|
798
|
+
<summary>All TypeScript definitions</summary>
|
|
803
799
|
|
|
804
800
|
```typescript
|
|
805
801
|
anyPass<T>(predicates: ((x: T) => boolean)[]): (input: T) => boolean;
|
|
@@ -892,7 +888,7 @@ test('works with multiple inputs', () => {
|
|
|
892
888
|
|
|
893
889
|
<details>
|
|
894
890
|
|
|
895
|
-
<summary><strong>
|
|
891
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
896
892
|
|
|
897
893
|
```typescript
|
|
898
894
|
import {anyPass, filter} from 'rambda'
|
|
@@ -936,6 +932,140 @@ describe('anyPass', () => {
|
|
|
936
932
|
|
|
937
933
|
[](#anyPass)
|
|
938
934
|
|
|
935
|
+
### ap
|
|
936
|
+
|
|
937
|
+
```typescript
|
|
938
|
+
|
|
939
|
+
ap<T, U>(fns: Array<(a: T) => U>[], vs: T[]): U[]
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
<details>
|
|
943
|
+
|
|
944
|
+
<summary>All TypeScript definitions</summary>
|
|
945
|
+
|
|
946
|
+
```typescript
|
|
947
|
+
ap<T, U>(fns: Array<(a: T) => U>[], vs: T[]): U[];
|
|
948
|
+
ap<T, U>(fns: Array<(a: T) => U>): (vs: T[]) => U[];
|
|
949
|
+
ap<R, A, B>(fn: (r: R, a: A) => B, fn1: (r: R) => A): (r: R) => B;
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
</details>
|
|
953
|
+
|
|
954
|
+
<details>
|
|
955
|
+
|
|
956
|
+
<summary><strong>R.ap</strong> source</summary>
|
|
957
|
+
|
|
958
|
+
```javascript
|
|
959
|
+
export function ap(functions, input){
|
|
960
|
+
if (arguments.length === 1){
|
|
961
|
+
return _inputs => ap(functions, _inputs)
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
return functions.reduce((acc, fn) => [ ...acc, ...input.map(fn) ], [])
|
|
965
|
+
}
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
</details>
|
|
969
|
+
|
|
970
|
+
<details>
|
|
971
|
+
|
|
972
|
+
<summary><strong>Tests</strong></summary>
|
|
973
|
+
|
|
974
|
+
```javascript
|
|
975
|
+
import { ap } from './ap.js'
|
|
976
|
+
|
|
977
|
+
function mult2(x){
|
|
978
|
+
return x * 2
|
|
979
|
+
}
|
|
980
|
+
function plus3(x){
|
|
981
|
+
return x + 3
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
test('happy', () => {
|
|
985
|
+
expect(ap([ mult2, plus3 ], [ 1, 2, 3 ])).toEqual([ 2, 4, 6, 4, 5, 6 ])
|
|
986
|
+
})
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
</details>
|
|
990
|
+
|
|
991
|
+
[](#ap)
|
|
992
|
+
|
|
993
|
+
### aperture
|
|
994
|
+
|
|
995
|
+
```typescript
|
|
996
|
+
|
|
997
|
+
aperture<N extends number, T>(n: N, list: T[]): Array<Tuple<T, N>> | []
|
|
998
|
+
```
|
|
999
|
+
|
|
1000
|
+
<details>
|
|
1001
|
+
|
|
1002
|
+
<summary>All TypeScript definitions</summary>
|
|
1003
|
+
|
|
1004
|
+
```typescript
|
|
1005
|
+
aperture<N extends number, T>(n: N, list: T[]): Array<Tuple<T, N>> | [];
|
|
1006
|
+
aperture<N extends number>(n: N): <T>(list: T[]) => Array<Tuple<T, N>> | [];
|
|
1007
|
+
```
|
|
1008
|
+
|
|
1009
|
+
</details>
|
|
1010
|
+
|
|
1011
|
+
<details>
|
|
1012
|
+
|
|
1013
|
+
<summary><strong>R.aperture</strong> source</summary>
|
|
1014
|
+
|
|
1015
|
+
```javascript
|
|
1016
|
+
export function aperture(step, list){
|
|
1017
|
+
if (arguments.length === 1){
|
|
1018
|
+
return _list => aperture(step, _list)
|
|
1019
|
+
}
|
|
1020
|
+
if (step > list.length) return []
|
|
1021
|
+
let idx = 0
|
|
1022
|
+
const limit = list.length - (step - 1)
|
|
1023
|
+
const acc = new Array(limit)
|
|
1024
|
+
while (idx < limit){
|
|
1025
|
+
acc[ idx ] = list.slice(idx, idx + step)
|
|
1026
|
+
idx += 1
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
return acc
|
|
1030
|
+
}
|
|
1031
|
+
```
|
|
1032
|
+
|
|
1033
|
+
</details>
|
|
1034
|
+
|
|
1035
|
+
<details>
|
|
1036
|
+
|
|
1037
|
+
<summary><strong>Tests</strong></summary>
|
|
1038
|
+
|
|
1039
|
+
```javascript
|
|
1040
|
+
import { aperture } from './aperture.js'
|
|
1041
|
+
|
|
1042
|
+
const list = [ 1, 2, 3, 4, 5, 6, 7 ]
|
|
1043
|
+
|
|
1044
|
+
test('happy', () => {
|
|
1045
|
+
expect(aperture(1, list)).toEqual([ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7 ] ])
|
|
1046
|
+
expect(aperture(2, list)).toEqual([
|
|
1047
|
+
[ 1, 2 ],
|
|
1048
|
+
[ 2, 3 ],
|
|
1049
|
+
[ 3, 4 ],
|
|
1050
|
+
[ 4, 5 ],
|
|
1051
|
+
[ 5, 6 ],
|
|
1052
|
+
[ 6, 7 ],
|
|
1053
|
+
])
|
|
1054
|
+
expect(aperture(3, list)).toEqual([
|
|
1055
|
+
[ 1, 2, 3 ],
|
|
1056
|
+
[ 2, 3, 4 ],
|
|
1057
|
+
[ 3, 4, 5 ],
|
|
1058
|
+
[ 4, 5, 6 ],
|
|
1059
|
+
[ 5, 6, 7 ],
|
|
1060
|
+
])
|
|
1061
|
+
expect(aperture(8, list)).toEqual([])
|
|
1062
|
+
})
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1065
|
+
</details>
|
|
1066
|
+
|
|
1067
|
+
[](#aperture)
|
|
1068
|
+
|
|
939
1069
|
### append
|
|
940
1070
|
|
|
941
1071
|
```typescript
|
|
@@ -949,7 +1079,7 @@ It adds element `x` at the end of `list`.
|
|
|
949
1079
|
|
|
950
1080
|
<details>
|
|
951
1081
|
|
|
952
|
-
<summary>All
|
|
1082
|
+
<summary>All TypeScript definitions</summary>
|
|
953
1083
|
|
|
954
1084
|
```typescript
|
|
955
1085
|
append<T>(x: T, list: T[]): T[];
|
|
@@ -1007,7 +1137,7 @@ test('with strings', () => {
|
|
|
1007
1137
|
|
|
1008
1138
|
<details>
|
|
1009
1139
|
|
|
1010
|
-
<summary><strong>
|
|
1140
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
1011
1141
|
|
|
1012
1142
|
```typescript
|
|
1013
1143
|
import {append} from 'rambda'
|
|
@@ -1047,7 +1177,7 @@ This is useful for creating a fixed-arity function from a variadic function. `fn
|
|
|
1047
1177
|
|
|
1048
1178
|
<details>
|
|
1049
1179
|
|
|
1050
|
-
<summary>All
|
|
1180
|
+
<summary>All TypeScript definitions</summary>
|
|
1051
1181
|
|
|
1052
1182
|
```typescript
|
|
1053
1183
|
apply<T = any>(fn: (...args: any[]) => T, args: any[]): T;
|
|
@@ -1104,7 +1234,7 @@ test('provides no way to specify context', () => {
|
|
|
1104
1234
|
|
|
1105
1235
|
<details>
|
|
1106
1236
|
|
|
1107
|
-
<summary><strong>
|
|
1237
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
1108
1238
|
|
|
1109
1239
|
```typescript
|
|
1110
1240
|
import {apply, identity} from 'rambda'
|
|
@@ -1143,7 +1273,7 @@ applySpec<Spec extends Record<string, AnyFunction>>(
|
|
|
1143
1273
|
|
|
1144
1274
|
<details>
|
|
1145
1275
|
|
|
1146
|
-
<summary>All
|
|
1276
|
+
<summary>All TypeScript definitions</summary>
|
|
1147
1277
|
|
|
1148
1278
|
```typescript
|
|
1149
1279
|
applySpec<Spec extends Record<string, AnyFunction>>(
|
|
@@ -1538,7 +1668,7 @@ test('restructure json object', () => {
|
|
|
1538
1668
|
|
|
1539
1669
|
<details>
|
|
1540
1670
|
|
|
1541
|
-
<summary><strong>
|
|
1671
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
1542
1672
|
|
|
1543
1673
|
```typescript
|
|
1544
1674
|
import {multiply, applySpec, inc, dec, add} from 'rambda'
|
|
@@ -1570,6 +1700,14 @@ describe('applySpec', () => {
|
|
|
1570
1700
|
|
|
1571
1701
|
[](#applySpec)
|
|
1572
1702
|
|
|
1703
|
+
### applyTo
|
|
1704
|
+
|
|
1705
|
+
[](#applyTo)
|
|
1706
|
+
|
|
1707
|
+
### ascend
|
|
1708
|
+
|
|
1709
|
+
[](#ascend)
|
|
1710
|
+
|
|
1573
1711
|
### assoc
|
|
1574
1712
|
|
|
1575
1713
|
It makes a shallow clone of `obj` with setting or overriding the property `prop` with `newValue`.
|
|
@@ -1591,7 +1729,7 @@ It makes a shallow clone of `obj` with setting or overriding with `newValue` the
|
|
|
1591
1729
|
|
|
1592
1730
|
<details>
|
|
1593
1731
|
|
|
1594
|
-
<summary>All
|
|
1732
|
+
<summary>All TypeScript definitions</summary>
|
|
1595
1733
|
|
|
1596
1734
|
```typescript
|
|
1597
1735
|
assocPath<Output>(path: Path, newValue: any, obj: object): Output;
|
|
@@ -1846,7 +1984,7 @@ test('happy', () => {
|
|
|
1846
1984
|
|
|
1847
1985
|
<details>
|
|
1848
1986
|
|
|
1849
|
-
<summary><strong>
|
|
1987
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
1850
1988
|
|
|
1851
1989
|
```typescript
|
|
1852
1990
|
import {assocPath} from 'rambda'
|
|
@@ -1887,6 +2025,10 @@ describe('R.assocPath - curried', () => {
|
|
|
1887
2025
|
|
|
1888
2026
|
[](#assocPath)
|
|
1889
2027
|
|
|
2028
|
+
### binary
|
|
2029
|
+
|
|
2030
|
+
[](#binary)
|
|
2031
|
+
|
|
1890
2032
|
### bind
|
|
1891
2033
|
|
|
1892
2034
|
```typescript
|
|
@@ -1900,7 +2042,7 @@ Creates a function that is bound to a context.
|
|
|
1900
2042
|
|
|
1901
2043
|
<details>
|
|
1902
2044
|
|
|
1903
|
-
<summary>All
|
|
2045
|
+
<summary>All TypeScript definitions</summary>
|
|
1904
2046
|
|
|
1905
2047
|
```typescript
|
|
1906
2048
|
bind<F extends AnyFunction, T>(fn: F, thisObj: T): (...args: Parameters<F>) => ReturnType<F>;
|
|
@@ -2025,7 +2167,7 @@ test('preserves arity', () => {
|
|
|
2025
2167
|
|
|
2026
2168
|
<details>
|
|
2027
2169
|
|
|
2028
|
-
<summary><strong>
|
|
2170
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2029
2171
|
|
|
2030
2172
|
```typescript
|
|
2031
2173
|
import {bind} from 'rambda'
|
|
@@ -2064,7 +2206,7 @@ This function will return `true`, if both `firstCondition` and `secondCondition`
|
|
|
2064
2206
|
|
|
2065
2207
|
<details>
|
|
2066
2208
|
|
|
2067
|
-
<summary>All
|
|
2209
|
+
<summary>All TypeScript definitions</summary>
|
|
2068
2210
|
|
|
2069
2211
|
```typescript
|
|
2070
2212
|
both(pred1: Pred, pred2: Pred): Pred;
|
|
@@ -2142,7 +2284,7 @@ test('skip evaluation of the second expression', () => {
|
|
|
2142
2284
|
|
|
2143
2285
|
<details>
|
|
2144
2286
|
|
|
2145
|
-
<summary><strong>
|
|
2287
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2146
2288
|
|
|
2147
2289
|
```typescript
|
|
2148
2290
|
import {both} from 'rambda'
|
|
@@ -2195,6 +2337,10 @@ describe('R.both', () => {
|
|
|
2195
2337
|
|
|
2196
2338
|
[](#both)
|
|
2197
2339
|
|
|
2340
|
+
### call
|
|
2341
|
+
|
|
2342
|
+
[](#call)
|
|
2343
|
+
|
|
2198
2344
|
### chain
|
|
2199
2345
|
|
|
2200
2346
|
```typescript
|
|
@@ -2208,7 +2354,7 @@ The method is also known as `flatMap`.
|
|
|
2208
2354
|
|
|
2209
2355
|
<details>
|
|
2210
2356
|
|
|
2211
|
-
<summary>All
|
|
2357
|
+
<summary>All TypeScript definitions</summary>
|
|
2212
2358
|
|
|
2213
2359
|
```typescript
|
|
2214
2360
|
chain<T, U>(fn: (n: T) => U[], list: T[]): U[];
|
|
@@ -2307,7 +2453,7 @@ test('@types/ramda broken test', () => {
|
|
|
2307
2453
|
|
|
2308
2454
|
<details>
|
|
2309
2455
|
|
|
2310
|
-
<summary><strong>
|
|
2456
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2311
2457
|
|
|
2312
2458
|
```typescript
|
|
2313
2459
|
import {chain} from 'rambda'
|
|
@@ -2350,6 +2496,14 @@ It creates a deep copy of the `input`, which may contain (nested) Arrays and Obj
|
|
|
2350
2496
|
|
|
2351
2497
|
[](#clone)
|
|
2352
2498
|
|
|
2499
|
+
### collectBy
|
|
2500
|
+
|
|
2501
|
+
[](#collectBy)
|
|
2502
|
+
|
|
2503
|
+
### comparator
|
|
2504
|
+
|
|
2505
|
+
[](#comparator)
|
|
2506
|
+
|
|
2353
2507
|
### complement
|
|
2354
2508
|
|
|
2355
2509
|
It returns `inverted` version of `origin` function that accept `input` as argument.
|
|
@@ -2368,6 +2522,10 @@ It performs right-to-left function composition.
|
|
|
2368
2522
|
|
|
2369
2523
|
[](#compose)
|
|
2370
2524
|
|
|
2525
|
+
### composeWith
|
|
2526
|
+
|
|
2527
|
+
[](#composeWith)
|
|
2528
|
+
|
|
2371
2529
|
### concat
|
|
2372
2530
|
|
|
2373
2531
|
It returns a new string or array, which is the result of merging `x` and `y`.
|
|
@@ -2419,7 +2577,7 @@ It counts elements in a list after each instance of the input list is passed thr
|
|
|
2419
2577
|
|
|
2420
2578
|
<details>
|
|
2421
2579
|
|
|
2422
|
-
<summary>All
|
|
2580
|
+
<summary>All TypeScript definitions</summary>
|
|
2423
2581
|
|
|
2424
2582
|
```typescript
|
|
2425
2583
|
countBy<T extends unknown>(transformFn: (x: T) => any, list: T[]): Record<string, number>;
|
|
@@ -2477,7 +2635,7 @@ test('happy', () => {
|
|
|
2477
2635
|
|
|
2478
2636
|
<details>
|
|
2479
2637
|
|
|
2480
|
-
<summary><strong>
|
|
2638
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2481
2639
|
|
|
2482
2640
|
```typescript
|
|
2483
2641
|
import {countBy} from 'rambda'
|
|
@@ -2538,7 +2696,7 @@ Else, it returns the first truthy `inputArguments` instance(from left to right).
|
|
|
2538
2696
|
|
|
2539
2697
|
<details>
|
|
2540
2698
|
|
|
2541
|
-
<summary>All
|
|
2699
|
+
<summary>All TypeScript definitions</summary>
|
|
2542
2700
|
|
|
2543
2701
|
```typescript
|
|
2544
2702
|
defaultTo<T>(defaultValue: T, input: T | null | undefined): T;
|
|
@@ -2605,7 +2763,7 @@ test('when inputArgument passes initial check', () => {
|
|
|
2605
2763
|
|
|
2606
2764
|
<details>
|
|
2607
2765
|
|
|
2608
|
-
<summary><strong>
|
|
2766
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2609
2767
|
|
|
2610
2768
|
```typescript
|
|
2611
2769
|
import {defaultTo} from 'rambda'
|
|
@@ -2626,6 +2784,10 @@ describe('R.defaultTo with Ramda spec', () => {
|
|
|
2626
2784
|
|
|
2627
2785
|
[](#defaultTo)
|
|
2628
2786
|
|
|
2787
|
+
### descend
|
|
2788
|
+
|
|
2789
|
+
[](#descend)
|
|
2790
|
+
|
|
2629
2791
|
### difference
|
|
2630
2792
|
|
|
2631
2793
|
```typescript
|
|
@@ -2641,7 +2803,7 @@ It returns the uniq set of all elements in the first list `a` not contained in t
|
|
|
2641
2803
|
|
|
2642
2804
|
<details>
|
|
2643
2805
|
|
|
2644
|
-
<summary>All
|
|
2806
|
+
<summary>All TypeScript definitions</summary>
|
|
2645
2807
|
|
|
2646
2808
|
```typescript
|
|
2647
2809
|
difference<T>(a: T[], b: T[]): T[];
|
|
@@ -2706,7 +2868,7 @@ test('should use R.equals', () => {
|
|
|
2706
2868
|
|
|
2707
2869
|
<details>
|
|
2708
2870
|
|
|
2709
|
-
<summary><strong>
|
|
2871
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2710
2872
|
|
|
2711
2873
|
```typescript
|
|
2712
2874
|
import {difference} from 'rambda'
|
|
@@ -2745,7 +2907,7 @@ differenceWith<T1, T2>(
|
|
|
2745
2907
|
|
|
2746
2908
|
<details>
|
|
2747
2909
|
|
|
2748
|
-
<summary>All
|
|
2910
|
+
<summary>All TypeScript definitions</summary>
|
|
2749
2911
|
|
|
2750
2912
|
```typescript
|
|
2751
2913
|
differenceWith<T1, T2>(
|
|
@@ -2844,7 +3006,7 @@ It returns `howMany` items dropped from beginning of list or string `input`.
|
|
|
2844
3006
|
|
|
2845
3007
|
<details>
|
|
2846
3008
|
|
|
2847
|
-
<summary>All
|
|
3009
|
+
<summary>All TypeScript definitions</summary>
|
|
2848
3010
|
|
|
2849
3011
|
```typescript
|
|
2850
3012
|
drop<T>(howMany: number, input: T[]): T[];
|
|
@@ -2908,7 +3070,7 @@ test('should return copy', () => {
|
|
|
2908
3070
|
|
|
2909
3071
|
<details>
|
|
2910
3072
|
|
|
2911
|
-
<summary><strong>
|
|
3073
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
2912
3074
|
|
|
2913
3075
|
```typescript
|
|
2914
3076
|
import {drop} from 'rambda'
|
|
@@ -2957,7 +3119,7 @@ It returns `howMany` items dropped from the end of list or string `input`.
|
|
|
2957
3119
|
|
|
2958
3120
|
<details>
|
|
2959
3121
|
|
|
2960
|
-
<summary>All
|
|
3122
|
+
<summary>All TypeScript definitions</summary>
|
|
2961
3123
|
|
|
2962
3124
|
```typescript
|
|
2963
3125
|
dropLast<T>(howMany: number, input: T[]): T[];
|
|
@@ -3025,7 +3187,7 @@ test('should return copy', () => {
|
|
|
3025
3187
|
|
|
3026
3188
|
<details>
|
|
3027
3189
|
|
|
3028
|
-
<summary><strong>
|
|
3190
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
3029
3191
|
|
|
3030
3192
|
```typescript
|
|
3031
3193
|
import {dropLast} from 'rambda'
|
|
@@ -3080,7 +3242,7 @@ It removes any successive duplicates according to `R.equals`.
|
|
|
3080
3242
|
|
|
3081
3243
|
<details>
|
|
3082
3244
|
|
|
3083
|
-
<summary>All
|
|
3245
|
+
<summary>All TypeScript definitions</summary>
|
|
3084
3246
|
|
|
3085
3247
|
```typescript
|
|
3086
3248
|
dropRepeats<T>(list: T[]): T[];
|
|
@@ -3170,7 +3332,7 @@ describe('brute force', () => {
|
|
|
3170
3332
|
|
|
3171
3333
|
<details>
|
|
3172
3334
|
|
|
3173
|
-
<summary><strong>
|
|
3335
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
3174
3336
|
|
|
3175
3337
|
```typescript
|
|
3176
3338
|
import {dropRepeats} from 'rambda'
|
|
@@ -3215,7 +3377,7 @@ This `predicate` function will return `true`, if any of the two input predicates
|
|
|
3215
3377
|
|
|
3216
3378
|
<details>
|
|
3217
3379
|
|
|
3218
|
-
<summary>All
|
|
3380
|
+
<summary>All TypeScript definitions</summary>
|
|
3219
3381
|
|
|
3220
3382
|
```typescript
|
|
3221
3383
|
either(firstPredicate: Pred, secondPredicate: Pred): Pred;
|
|
@@ -3300,7 +3462,7 @@ test('case 2', () => {
|
|
|
3300
3462
|
|
|
3301
3463
|
<details>
|
|
3302
3464
|
|
|
3303
|
-
<summary><strong>
|
|
3465
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
3304
3466
|
|
|
3305
3467
|
```typescript
|
|
3306
3468
|
import {either} from 'rambda'
|
|
@@ -3367,7 +3529,7 @@ When iterable is a list, then it uses R.equals to determine if the target list e
|
|
|
3367
3529
|
|
|
3368
3530
|
<details>
|
|
3369
3531
|
|
|
3370
|
-
<summary>All
|
|
3532
|
+
<summary>All TypeScript definitions</summary>
|
|
3371
3533
|
|
|
3372
3534
|
```typescript
|
|
3373
3535
|
endsWith<T extends string>(question: T, str: string): boolean;
|
|
@@ -3478,7 +3640,7 @@ describe('brute force', () => {
|
|
|
3478
3640
|
|
|
3479
3641
|
<details>
|
|
3480
3642
|
|
|
3481
|
-
<summary><strong>
|
|
3643
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
3482
3644
|
|
|
3483
3645
|
```typescript
|
|
3484
3646
|
import {endsWith} from 'rambda'
|
|
@@ -3535,7 +3697,7 @@ It deeply compares `x` and `y` and returns `true` if they are equal.
|
|
|
3535
3697
|
|
|
3536
3698
|
<details>
|
|
3537
3699
|
|
|
3538
|
-
<summary>All
|
|
3700
|
+
<summary>All TypeScript definitions</summary>
|
|
3539
3701
|
|
|
3540
3702
|
```typescript
|
|
3541
3703
|
equals<T>(x: T, y: T): boolean;
|
|
@@ -4061,7 +4223,7 @@ describe('brute force', () => {
|
|
|
4061
4223
|
|
|
4062
4224
|
<details>
|
|
4063
4225
|
|
|
4064
|
-
<summary><strong>
|
|
4226
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4065
4227
|
|
|
4066
4228
|
```typescript
|
|
4067
4229
|
import {equals} from 'rambda'
|
|
@@ -4102,7 +4264,7 @@ It takes object or array of functions as set of rules. These `rules` are applied
|
|
|
4102
4264
|
|
|
4103
4265
|
<details>
|
|
4104
4266
|
|
|
4105
|
-
<summary>All
|
|
4267
|
+
<summary>All TypeScript definitions</summary>
|
|
4106
4268
|
|
|
4107
4269
|
```typescript
|
|
4108
4270
|
evolve<T, U>(rules: ((x: T) => U)[], list: T[]): U[];
|
|
@@ -4310,7 +4472,7 @@ describe('brute force', () => {
|
|
|
4310
4472
|
|
|
4311
4473
|
<details>
|
|
4312
4474
|
|
|
4313
|
-
<summary><strong>
|
|
4475
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4314
4476
|
|
|
4315
4477
|
```typescript
|
|
4316
4478
|
import {evolve, add} from 'rambda'
|
|
@@ -4365,7 +4527,7 @@ F(): boolean
|
|
|
4365
4527
|
|
|
4366
4528
|
<details>
|
|
4367
4529
|
|
|
4368
|
-
<summary>All
|
|
4530
|
+
<summary>All TypeScript definitions</summary>
|
|
4369
4531
|
|
|
4370
4532
|
```typescript
|
|
4371
4533
|
F(): boolean;
|
|
@@ -4400,7 +4562,7 @@ It filters list or object `input` using a `predicate` function.
|
|
|
4400
4562
|
|
|
4401
4563
|
<details>
|
|
4402
4564
|
|
|
4403
|
-
<summary>All
|
|
4565
|
+
<summary>All TypeScript definitions</summary>
|
|
4404
4566
|
|
|
4405
4567
|
```typescript
|
|
4406
4568
|
filter<T>(predicate: Predicate<T>): (input: T[]) => T[];
|
|
@@ -4541,7 +4703,7 @@ test('bad inputs difference between Ramda and Rambda', () => {
|
|
|
4541
4703
|
|
|
4542
4704
|
<details>
|
|
4543
4705
|
|
|
4544
|
-
<summary><strong>
|
|
4706
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4545
4707
|
|
|
4546
4708
|
```typescript
|
|
4547
4709
|
import {filter} from 'rambda'
|
|
@@ -4609,7 +4771,7 @@ If there is no such element, it returns `undefined`.
|
|
|
4609
4771
|
|
|
4610
4772
|
<details>
|
|
4611
4773
|
|
|
4612
|
-
<summary>All
|
|
4774
|
+
<summary>All TypeScript definitions</summary>
|
|
4613
4775
|
|
|
4614
4776
|
```typescript
|
|
4615
4777
|
find<T>(predicate: (x: T) => boolean, list: T[]): T | undefined;
|
|
@@ -4671,7 +4833,7 @@ test('with empty list', () => {
|
|
|
4671
4833
|
|
|
4672
4834
|
<details>
|
|
4673
4835
|
|
|
4674
|
-
<summary><strong>
|
|
4836
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4675
4837
|
|
|
4676
4838
|
```typescript
|
|
4677
4839
|
import {find} from 'rambda'
|
|
@@ -4711,7 +4873,7 @@ If there is no such element, then `-1` is returned.
|
|
|
4711
4873
|
|
|
4712
4874
|
<details>
|
|
4713
4875
|
|
|
4714
|
-
<summary>All
|
|
4876
|
+
<summary>All TypeScript definitions</summary>
|
|
4715
4877
|
|
|
4716
4878
|
```typescript
|
|
4717
4879
|
findIndex<T>(predicate: (x: T) => boolean, list: T[]): number;
|
|
@@ -4764,7 +4926,7 @@ test('happy', () => {
|
|
|
4764
4926
|
|
|
4765
4927
|
<details>
|
|
4766
4928
|
|
|
4767
|
-
<summary><strong>
|
|
4929
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4768
4930
|
|
|
4769
4931
|
```typescript
|
|
4770
4932
|
import {findIndex} from 'rambda'
|
|
@@ -4804,7 +4966,7 @@ If there is no such element, then `undefined` is returned.
|
|
|
4804
4966
|
|
|
4805
4967
|
<details>
|
|
4806
4968
|
|
|
4807
|
-
<summary>All
|
|
4969
|
+
<summary>All TypeScript definitions</summary>
|
|
4808
4970
|
|
|
4809
4971
|
```typescript
|
|
4810
4972
|
findLast<T>(fn: (x: T) => boolean, list: T[]): T | undefined;
|
|
@@ -4893,7 +5055,7 @@ test('ramda 4', () => {
|
|
|
4893
5055
|
|
|
4894
5056
|
<details>
|
|
4895
5057
|
|
|
4896
|
-
<summary><strong>
|
|
5058
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
4897
5059
|
|
|
4898
5060
|
```typescript
|
|
4899
5061
|
import {findLast} from 'rambda'
|
|
@@ -4933,7 +5095,7 @@ If there is no such element, then `-1` is returned.
|
|
|
4933
5095
|
|
|
4934
5096
|
<details>
|
|
4935
5097
|
|
|
4936
|
-
<summary>All
|
|
5098
|
+
<summary>All TypeScript definitions</summary>
|
|
4937
5099
|
|
|
4938
5100
|
```typescript
|
|
4939
5101
|
findLastIndex<T>(predicate: (x: T) => boolean, list: T[]): number;
|
|
@@ -5023,7 +5185,7 @@ test('ramda 4', () => {
|
|
|
5023
5185
|
|
|
5024
5186
|
<details>
|
|
5025
5187
|
|
|
5026
|
-
<summary><strong>
|
|
5188
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5027
5189
|
|
|
5028
5190
|
```typescript
|
|
5029
5191
|
import {findLastIndex} from 'rambda'
|
|
@@ -5061,7 +5223,7 @@ It deeply flattens an array.
|
|
|
5061
5223
|
|
|
5062
5224
|
<details>
|
|
5063
5225
|
|
|
5064
|
-
<summary>All
|
|
5226
|
+
<summary>All TypeScript definitions</summary>
|
|
5065
5227
|
|
|
5066
5228
|
```typescript
|
|
5067
5229
|
flatten<T>(list: any[]): T[];
|
|
@@ -5120,7 +5282,7 @@ test('readme example', () => {
|
|
|
5120
5282
|
|
|
5121
5283
|
<details>
|
|
5122
5284
|
|
|
5123
|
-
<summary><strong>
|
|
5285
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5124
5286
|
|
|
5125
5287
|
```typescript
|
|
5126
5288
|
import {flatten} from 'rambda'
|
|
@@ -5158,7 +5320,7 @@ It applies `iterable` function over all members of `list` and returns `list`.
|
|
|
5158
5320
|
|
|
5159
5321
|
<details>
|
|
5160
5322
|
|
|
5161
|
-
<summary>All
|
|
5323
|
+
<summary>All TypeScript definitions</summary>
|
|
5162
5324
|
|
|
5163
5325
|
```typescript
|
|
5164
5326
|
forEach<T>(fn: Iterator<T, void>, list: T[]): T[];
|
|
@@ -5282,7 +5444,7 @@ test('returns the input', () => {
|
|
|
5282
5444
|
|
|
5283
5445
|
<details>
|
|
5284
5446
|
|
|
5285
|
-
<summary><strong>
|
|
5447
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5286
5448
|
|
|
5287
5449
|
```typescript
|
|
5288
5450
|
import {forEach} from 'rambda'
|
|
@@ -5374,7 +5536,7 @@ It returns `true` if `obj` has property `prop`.
|
|
|
5374
5536
|
|
|
5375
5537
|
<details>
|
|
5376
5538
|
|
|
5377
|
-
<summary>All
|
|
5539
|
+
<summary>All TypeScript definitions</summary>
|
|
5378
5540
|
|
|
5379
5541
|
```typescript
|
|
5380
5542
|
has<T>(prop: string, obj: T): boolean;
|
|
@@ -5424,7 +5586,7 @@ test('with non-object', () => {
|
|
|
5424
5586
|
|
|
5425
5587
|
<details>
|
|
5426
5588
|
|
|
5427
|
-
<summary><strong>
|
|
5589
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5428
5590
|
|
|
5429
5591
|
```typescript
|
|
5430
5592
|
import {has} from 'rambda'
|
|
@@ -5459,7 +5621,7 @@ It will return true, if `input` object has truthy `path`(calculated with `R.path
|
|
|
5459
5621
|
|
|
5460
5622
|
<details>
|
|
5461
5623
|
|
|
5462
|
-
<summary>All
|
|
5624
|
+
<summary>All TypeScript definitions</summary>
|
|
5463
5625
|
|
|
5464
5626
|
```typescript
|
|
5465
5627
|
hasPath<T>(
|
|
@@ -5523,7 +5685,7 @@ test('when false', () => {
|
|
|
5523
5685
|
|
|
5524
5686
|
<details>
|
|
5525
5687
|
|
|
5526
|
-
<summary><strong>
|
|
5688
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5527
5689
|
|
|
5528
5690
|
```typescript
|
|
5529
5691
|
import {hasPath} from 'rambda'
|
|
@@ -5563,7 +5725,7 @@ It returns the first element of list or string `input`.
|
|
|
5563
5725
|
|
|
5564
5726
|
<details>
|
|
5565
5727
|
|
|
5566
|
-
<summary>All
|
|
5728
|
+
<summary>All TypeScript definitions</summary>
|
|
5567
5729
|
|
|
5568
5730
|
```typescript
|
|
5569
5731
|
head(input: string): string;
|
|
@@ -5606,7 +5768,7 @@ test('head', () => {
|
|
|
5606
5768
|
|
|
5607
5769
|
<details>
|
|
5608
5770
|
|
|
5609
|
-
<summary><strong>
|
|
5771
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5610
5772
|
|
|
5611
5773
|
```typescript
|
|
5612
5774
|
import {mixedList, mixedListConst} from '_internals/typescriptTestUtils'
|
|
@@ -5668,7 +5830,7 @@ It just passes back the supplied `input` argument.
|
|
|
5668
5830
|
|
|
5669
5831
|
<details>
|
|
5670
5832
|
|
|
5671
|
-
<summary>All
|
|
5833
|
+
<summary>All TypeScript definitions</summary>
|
|
5672
5834
|
|
|
5673
5835
|
```typescript
|
|
5674
5836
|
identity<T>(input: T): T;
|
|
@@ -5706,7 +5868,7 @@ test('happy', () => {
|
|
|
5706
5868
|
|
|
5707
5869
|
<details>
|
|
5708
5870
|
|
|
5709
|
-
<summary><strong>
|
|
5871
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5710
5872
|
|
|
5711
5873
|
```typescript
|
|
5712
5874
|
import {identity} from 'rambda'
|
|
@@ -5742,7 +5904,7 @@ When `fn`` is called with `input` argument, it will return either `onTrue(input)
|
|
|
5742
5904
|
|
|
5743
5905
|
<details>
|
|
5744
5906
|
|
|
5745
|
-
<summary>All
|
|
5907
|
+
<summary>All TypeScript definitions</summary>
|
|
5746
5908
|
|
|
5747
5909
|
```typescript
|
|
5748
5910
|
ifElse<T, TFiltered extends T, TOnTrueResult, TOnFalseResult>(
|
|
@@ -5885,7 +6047,7 @@ test('simple arity of 2', () => {
|
|
|
5885
6047
|
|
|
5886
6048
|
<details>
|
|
5887
6049
|
|
|
5888
|
-
<summary><strong>
|
|
6050
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
5889
6051
|
|
|
5890
6052
|
```typescript
|
|
5891
6053
|
import {ifElse} from 'rambda'
|
|
@@ -5958,7 +6120,7 @@ If `input` is array, then `R.equals` is used to define if `valueToFind` belongs
|
|
|
5958
6120
|
|
|
5959
6121
|
<details>
|
|
5960
6122
|
|
|
5961
|
-
<summary>All
|
|
6123
|
+
<summary>All TypeScript definitions</summary>
|
|
5962
6124
|
|
|
5963
6125
|
```typescript
|
|
5964
6126
|
includes<T extends string>(valueToFind: T, input: string): boolean;
|
|
@@ -6059,7 +6221,7 @@ test('throws on wrong input - match ramda behaviour', () => {
|
|
|
6059
6221
|
|
|
6060
6222
|
<details>
|
|
6061
6223
|
|
|
6062
|
-
<summary><strong>
|
|
6224
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6063
6225
|
|
|
6064
6226
|
```typescript
|
|
6065
6227
|
import {includes} from 'rambda'
|
|
@@ -6123,7 +6285,7 @@ It returns all but the last element of list or string `input`.
|
|
|
6123
6285
|
|
|
6124
6286
|
<details>
|
|
6125
6287
|
|
|
6126
|
-
<summary>All
|
|
6288
|
+
<summary>All TypeScript definitions</summary>
|
|
6127
6289
|
|
|
6128
6290
|
```typescript
|
|
6129
6291
|
init<T extends unknown[]>(input: T): T extends readonly [...infer U, any] ? U : [...T];
|
|
@@ -6179,7 +6341,7 @@ test('with string', () => {
|
|
|
6179
6341
|
|
|
6180
6342
|
<details>
|
|
6181
6343
|
|
|
6182
|
-
<summary><strong>
|
|
6344
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6183
6345
|
|
|
6184
6346
|
```typescript
|
|
6185
6347
|
import {init} from 'rambda'
|
|
@@ -6244,7 +6406,7 @@ It returns `true` if `x` is `empty`.
|
|
|
6244
6406
|
|
|
6245
6407
|
<details>
|
|
6246
6408
|
|
|
6247
|
-
<summary>All
|
|
6409
|
+
<summary>All TypeScript definitions</summary>
|
|
6248
6410
|
|
|
6249
6411
|
```typescript
|
|
6250
6412
|
isEmpty<T>(x: T): boolean;
|
|
@@ -6306,7 +6468,7 @@ test('happy', () => {
|
|
|
6306
6468
|
|
|
6307
6469
|
<details>
|
|
6308
6470
|
|
|
6309
|
-
<summary><strong>
|
|
6471
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6310
6472
|
|
|
6311
6473
|
```typescript
|
|
6312
6474
|
import {isEmpty} from 'rambda'
|
|
@@ -6336,7 +6498,7 @@ It returns `true` if `x` is either `null` or `undefined`.
|
|
|
6336
6498
|
|
|
6337
6499
|
<details>
|
|
6338
6500
|
|
|
6339
|
-
<summary>All
|
|
6501
|
+
<summary>All TypeScript definitions</summary>
|
|
6340
6502
|
|
|
6341
6503
|
```typescript
|
|
6342
6504
|
isNil(x: any): x is null | undefined;
|
|
@@ -6389,7 +6551,7 @@ It returns a string of all `list` instances joined with a `glue`.
|
|
|
6389
6551
|
|
|
6390
6552
|
<details>
|
|
6391
6553
|
|
|
6392
|
-
<summary>All
|
|
6554
|
+
<summary>All TypeScript definitions</summary>
|
|
6393
6555
|
|
|
6394
6556
|
```typescript
|
|
6395
6557
|
join<T>(glue: string, list: T[]): string;
|
|
@@ -6434,7 +6596,7 @@ test('curry', () => {
|
|
|
6434
6596
|
|
|
6435
6597
|
<details>
|
|
6436
6598
|
|
|
6437
|
-
<summary><strong>
|
|
6599
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6438
6600
|
|
|
6439
6601
|
```typescript
|
|
6440
6602
|
import {join} from 'rambda'
|
|
@@ -6464,7 +6626,7 @@ It applies list of function to a list of inputs.
|
|
|
6464
6626
|
|
|
6465
6627
|
<details>
|
|
6466
6628
|
|
|
6467
|
-
<summary>All
|
|
6629
|
+
<summary>All TypeScript definitions</summary>
|
|
6468
6630
|
|
|
6469
6631
|
```typescript
|
|
6470
6632
|
juxt<A extends any[], R1>(fns: [(...a: A) => R1]): (...a: A) => [R1];
|
|
@@ -6509,7 +6671,7 @@ test('happy', () => {
|
|
|
6509
6671
|
|
|
6510
6672
|
<details>
|
|
6511
6673
|
|
|
6512
|
-
<summary><strong>
|
|
6674
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6513
6675
|
|
|
6514
6676
|
```typescript
|
|
6515
6677
|
import {juxt} from 'rambda'
|
|
@@ -6540,7 +6702,7 @@ It applies `Object.keys` over `x` and returns its keys.
|
|
|
6540
6702
|
|
|
6541
6703
|
<details>
|
|
6542
6704
|
|
|
6543
|
-
<summary>All
|
|
6705
|
+
<summary>All TypeScript definitions</summary>
|
|
6544
6706
|
|
|
6545
6707
|
```typescript
|
|
6546
6708
|
keys<T extends object>(x: T): (keyof T)[];
|
|
@@ -6577,7 +6739,7 @@ test('happy', () => {
|
|
|
6577
6739
|
|
|
6578
6740
|
<details>
|
|
6579
6741
|
|
|
6580
|
-
<summary><strong>
|
|
6742
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6581
6743
|
|
|
6582
6744
|
```typescript
|
|
6583
6745
|
import {keys} from 'rambda'
|
|
@@ -6609,7 +6771,7 @@ It returns the last element of `input`, as the `input` can be either a string or
|
|
|
6609
6771
|
|
|
6610
6772
|
<details>
|
|
6611
6773
|
|
|
6612
|
-
<summary>All
|
|
6774
|
+
<summary>All TypeScript definitions</summary>
|
|
6613
6775
|
|
|
6614
6776
|
```typescript
|
|
6615
6777
|
last(input: string): string;
|
|
@@ -6657,7 +6819,7 @@ test('with string', () => {
|
|
|
6657
6819
|
|
|
6658
6820
|
<details>
|
|
6659
6821
|
|
|
6660
|
-
<summary><strong>
|
|
6822
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6661
6823
|
|
|
6662
6824
|
```typescript
|
|
6663
6825
|
import {mixedList, mixedListConst} from '_internals/typescriptTestUtils'
|
|
@@ -6713,7 +6875,7 @@ If there is no such index, then `-1` is returned.
|
|
|
6713
6875
|
|
|
6714
6876
|
<details>
|
|
6715
6877
|
|
|
6716
|
-
<summary>All
|
|
6878
|
+
<summary>All TypeScript definitions</summary>
|
|
6717
6879
|
|
|
6718
6880
|
```typescript
|
|
6719
6881
|
lastIndexOf<T>(target: T, list: T[]): number;
|
|
@@ -6810,7 +6972,7 @@ describe('brute force', () => {
|
|
|
6810
6972
|
|
|
6811
6973
|
<details>
|
|
6812
6974
|
|
|
6813
|
-
<summary><strong>
|
|
6975
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6814
6976
|
|
|
6815
6977
|
```typescript
|
|
6816
6978
|
import {lastIndexOf} from 'rambda'
|
|
@@ -6846,7 +7008,7 @@ It returns the `length` property of list or string `input`.
|
|
|
6846
7008
|
|
|
6847
7009
|
<details>
|
|
6848
7010
|
|
|
6849
|
-
<summary>All
|
|
7011
|
+
<summary>All TypeScript definitions</summary>
|
|
6850
7012
|
|
|
6851
7013
|
```typescript
|
|
6852
7014
|
length<T>(input: T[]): number;
|
|
@@ -6932,7 +7094,7 @@ The setter should not mutate the data structure.
|
|
|
6932
7094
|
|
|
6933
7095
|
<details>
|
|
6934
7096
|
|
|
6935
|
-
<summary>All
|
|
7097
|
+
<summary>All TypeScript definitions</summary>
|
|
6936
7098
|
|
|
6937
7099
|
```typescript
|
|
6938
7100
|
lens<T, U, V>(getter: (s: T) => U, setter: (a: U, s: T) => V): Lens;
|
|
@@ -6958,7 +7120,7 @@ export function lens(getter, setter){
|
|
|
6958
7120
|
|
|
6959
7121
|
<details>
|
|
6960
7122
|
|
|
6961
|
-
<summary><strong>
|
|
7123
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
6962
7124
|
|
|
6963
7125
|
```typescript
|
|
6964
7126
|
import {lens, assoc} from 'rambda'
|
|
@@ -6995,7 +7157,7 @@ It returns a lens that focuses on specified `index`.
|
|
|
6995
7157
|
|
|
6996
7158
|
<details>
|
|
6997
7159
|
|
|
6998
|
-
<summary>All
|
|
7160
|
+
<summary>All TypeScript definitions</summary>
|
|
6999
7161
|
|
|
7000
7162
|
```typescript
|
|
7001
7163
|
lensIndex(index: number): Lens;
|
|
@@ -7086,7 +7248,7 @@ test('get (set(set s v1) v2) === v2', () => {
|
|
|
7086
7248
|
|
|
7087
7249
|
<details>
|
|
7088
7250
|
|
|
7089
|
-
<summary><strong>
|
|
7251
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7090
7252
|
|
|
7091
7253
|
```typescript
|
|
7092
7254
|
import {view, lensIndex} from 'rambda'
|
|
@@ -7122,7 +7284,7 @@ It returns a lens that focuses on specified `path`.
|
|
|
7122
7284
|
|
|
7123
7285
|
<details>
|
|
7124
7286
|
|
|
7125
|
-
<summary>All
|
|
7287
|
+
<summary>All TypeScript definitions</summary>
|
|
7126
7288
|
|
|
7127
7289
|
```typescript
|
|
7128
7290
|
lensPath(path: RamdaPath): Lens;
|
|
@@ -7282,7 +7444,7 @@ test('get (set(set s v1) v2) === v2', () => {
|
|
|
7282
7444
|
|
|
7283
7445
|
<details>
|
|
7284
7446
|
|
|
7285
|
-
<summary><strong>
|
|
7447
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7286
7448
|
|
|
7287
7449
|
```typescript
|
|
7288
7450
|
import {lensPath, view} from 'rambda'
|
|
@@ -7336,7 +7498,7 @@ It returns a lens that focuses on specified property `prop`.
|
|
|
7336
7498
|
|
|
7337
7499
|
<details>
|
|
7338
7500
|
|
|
7339
|
-
<summary>All
|
|
7501
|
+
<summary>All TypeScript definitions</summary>
|
|
7340
7502
|
|
|
7341
7503
|
```typescript
|
|
7342
7504
|
lensProp(prop: string): {
|
|
@@ -7468,7 +7630,7 @@ test('get (set(set s v1) v2) === v2', () => {
|
|
|
7468
7630
|
|
|
7469
7631
|
<details>
|
|
7470
7632
|
|
|
7471
|
-
<summary><strong>
|
|
7633
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7472
7634
|
|
|
7473
7635
|
```typescript
|
|
7474
7636
|
import {lensProp, view} from 'rambda'
|
|
@@ -7510,7 +7672,7 @@ It works with both array and object.
|
|
|
7510
7672
|
|
|
7511
7673
|
<details>
|
|
7512
7674
|
|
|
7513
|
-
<summary>All
|
|
7675
|
+
<summary>All TypeScript definitions</summary>
|
|
7514
7676
|
|
|
7515
7677
|
```typescript
|
|
7516
7678
|
map<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;
|
|
@@ -7651,7 +7813,7 @@ test('bad inputs difference between Ramda and Rambda', () => {
|
|
|
7651
7813
|
|
|
7652
7814
|
<details>
|
|
7653
7815
|
|
|
7654
|
-
<summary><strong>
|
|
7816
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7655
7817
|
|
|
7656
7818
|
```typescript
|
|
7657
7819
|
import {map} from 'rambda'
|
|
@@ -7752,7 +7914,7 @@ It works the same way as `R.map` does for objects. It is added as Ramda also has
|
|
|
7752
7914
|
|
|
7753
7915
|
<details>
|
|
7754
7916
|
|
|
7755
|
-
<summary>All
|
|
7917
|
+
<summary>All TypeScript definitions</summary>
|
|
7756
7918
|
|
|
7757
7919
|
```typescript
|
|
7758
7920
|
mapObjIndexed<T>(fn: ObjectIterator<T, T>, iterable: Dictionary<T>): Dictionary<T>;
|
|
@@ -7765,7 +7927,7 @@ mapObjIndexed<T, U>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dict
|
|
|
7765
7927
|
|
|
7766
7928
|
<details>
|
|
7767
7929
|
|
|
7768
|
-
<summary><strong>
|
|
7930
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7769
7931
|
|
|
7770
7932
|
```typescript
|
|
7771
7933
|
import {mapObjIndexed} from 'rambda'
|
|
@@ -7829,7 +7991,7 @@ Curried version of `String.prototype.match` which returns empty array, when ther
|
|
|
7829
7991
|
|
|
7830
7992
|
<details>
|
|
7831
7993
|
|
|
7832
|
-
<summary>All
|
|
7994
|
+
<summary>All TypeScript definitions</summary>
|
|
7833
7995
|
|
|
7834
7996
|
```typescript
|
|
7835
7997
|
match(regExpression: RegExp, str: string): string[];
|
|
@@ -7886,7 +8048,7 @@ test('throwing', () => {
|
|
|
7886
8048
|
|
|
7887
8049
|
<details>
|
|
7888
8050
|
|
|
7889
|
-
<summary><strong>
|
|
8051
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7890
8052
|
|
|
7891
8053
|
```typescript
|
|
7892
8054
|
import {match} from 'rambda'
|
|
@@ -7946,7 +8108,7 @@ It returns the mean value of `list` input.
|
|
|
7946
8108
|
|
|
7947
8109
|
<details>
|
|
7948
8110
|
|
|
7949
|
-
<summary>All
|
|
8111
|
+
<summary>All TypeScript definitions</summary>
|
|
7950
8112
|
|
|
7951
8113
|
```typescript
|
|
7952
8114
|
mean(list: number[]): number;
|
|
@@ -7988,7 +8150,7 @@ test('with NaN', () => {
|
|
|
7988
8150
|
|
|
7989
8151
|
<details>
|
|
7990
8152
|
|
|
7991
|
-
<summary><strong>
|
|
8153
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
7992
8154
|
|
|
7993
8155
|
```typescript
|
|
7994
8156
|
import {mean} from 'rambda'
|
|
@@ -8019,7 +8181,7 @@ It returns the median value of `list` input.
|
|
|
8019
8181
|
|
|
8020
8182
|
<details>
|
|
8021
8183
|
|
|
8022
|
-
<summary>All
|
|
8184
|
+
<summary>All TypeScript definitions</summary>
|
|
8023
8185
|
|
|
8024
8186
|
```typescript
|
|
8025
8187
|
median(list: number[]): number;
|
|
@@ -8074,7 +8236,7 @@ test('with empty array', () => {
|
|
|
8074
8236
|
|
|
8075
8237
|
<details>
|
|
8076
8238
|
|
|
8077
|
-
<summary><strong>
|
|
8239
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8078
8240
|
|
|
8079
8241
|
```typescript
|
|
8080
8242
|
import {median} from 'rambda'
|
|
@@ -8111,7 +8273,7 @@ It merges all objects of `list` array sequentially and returns the result.
|
|
|
8111
8273
|
|
|
8112
8274
|
<details>
|
|
8113
8275
|
|
|
8114
|
-
<summary>All
|
|
8276
|
+
<summary>All TypeScript definitions</summary>
|
|
8115
8277
|
|
|
8116
8278
|
```typescript
|
|
8117
8279
|
mergeAll<T>(list: object[]): T;
|
|
@@ -8193,7 +8355,7 @@ describe('acts as if nil values are simply empty objects', () => {
|
|
|
8193
8355
|
|
|
8194
8356
|
<details>
|
|
8195
8357
|
|
|
8196
|
-
<summary><strong>
|
|
8358
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8197
8359
|
|
|
8198
8360
|
```typescript
|
|
8199
8361
|
import {mergeAll} from 'rambda'
|
|
@@ -8234,7 +8396,7 @@ Creates a new object with the own properties of the first object merged with the
|
|
|
8234
8396
|
|
|
8235
8397
|
<details>
|
|
8236
8398
|
|
|
8237
|
-
<summary>All
|
|
8399
|
+
<summary>All TypeScript definitions</summary>
|
|
8238
8400
|
|
|
8239
8401
|
```typescript
|
|
8240
8402
|
mergeDeepRight<Output>(target: object, newProps: object): Output;
|
|
@@ -8414,7 +8576,7 @@ test('functions are not discarded', () => {
|
|
|
8414
8576
|
|
|
8415
8577
|
<details>
|
|
8416
8578
|
|
|
8417
|
-
<summary><strong>
|
|
8579
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8418
8580
|
|
|
8419
8581
|
```typescript
|
|
8420
8582
|
import {mergeDeepRight} from 'rambda'
|
|
@@ -8448,7 +8610,7 @@ Same as `R.merge`, but in opposite direction.
|
|
|
8448
8610
|
|
|
8449
8611
|
<details>
|
|
8450
8612
|
|
|
8451
|
-
<summary>All
|
|
8613
|
+
<summary>All TypeScript definitions</summary>
|
|
8452
8614
|
|
|
8453
8615
|
```typescript
|
|
8454
8616
|
mergeLeft<Output>(newProps: object, target: object): Output;
|
|
@@ -8512,7 +8674,7 @@ test('when undefined or null instead of object', () => {
|
|
|
8512
8674
|
|
|
8513
8675
|
<details>
|
|
8514
8676
|
|
|
8515
|
-
<summary><strong>
|
|
8677
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8516
8678
|
|
|
8517
8679
|
```typescript
|
|
8518
8680
|
import {mergeLeft} from 'rambda'
|
|
@@ -8557,7 +8719,7 @@ It takes two objects and a function, which will be used when there is an overlap
|
|
|
8557
8719
|
|
|
8558
8720
|
<details>
|
|
8559
8721
|
|
|
8560
|
-
<summary>All
|
|
8722
|
+
<summary>All TypeScript definitions</summary>
|
|
8561
8723
|
|
|
8562
8724
|
```typescript
|
|
8563
8725
|
mergeWith(fn: (x: any, z: any) => any, a: Record<string, unknown>, b: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -8676,7 +8838,7 @@ describe('acts as if nil values are simply empty objects', () => {
|
|
|
8676
8838
|
|
|
8677
8839
|
<details>
|
|
8678
8840
|
|
|
8679
|
-
<summary><strong>
|
|
8841
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8680
8842
|
|
|
8681
8843
|
```typescript
|
|
8682
8844
|
import {concat, mergeWith} from 'rambda'
|
|
@@ -8758,7 +8920,7 @@ modify<T extends object, K extends keyof T, P>(
|
|
|
8758
8920
|
|
|
8759
8921
|
<details>
|
|
8760
8922
|
|
|
8761
|
-
<summary>All
|
|
8923
|
+
<summary>All TypeScript definitions</summary>
|
|
8762
8924
|
|
|
8763
8925
|
```typescript
|
|
8764
8926
|
modify<T extends object, K extends keyof T, P>(
|
|
@@ -8907,7 +9069,7 @@ describe('brute force', () => {
|
|
|
8907
9069
|
|
|
8908
9070
|
<details>
|
|
8909
9071
|
|
|
8910
|
-
<summary><strong>
|
|
9072
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
8911
9073
|
|
|
8912
9074
|
```typescript
|
|
8913
9075
|
import {modify, add} from 'rambda'
|
|
@@ -8946,7 +9108,7 @@ It changes a property of object on the base of provided path and transformer fun
|
|
|
8946
9108
|
|
|
8947
9109
|
<details>
|
|
8948
9110
|
|
|
8949
|
-
<summary>All
|
|
9111
|
+
<summary>All TypeScript definitions</summary>
|
|
8950
9112
|
|
|
8951
9113
|
```typescript
|
|
8952
9114
|
modifyPath<T extends Record<string, unknown>>(path: Path, fn: (x: any) => unknown, object: Record<string, unknown>): T;
|
|
@@ -9025,7 +9187,7 @@ test('with array', () => {
|
|
|
9025
9187
|
|
|
9026
9188
|
<details>
|
|
9027
9189
|
|
|
9028
|
-
<summary><strong>
|
|
9190
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9029
9191
|
|
|
9030
9192
|
```typescript
|
|
9031
9193
|
import {modifyPath} from 'rambda'
|
|
@@ -9094,7 +9256,7 @@ It returns `true`, if all members of array `list` returns `false`, when applied
|
|
|
9094
9256
|
|
|
9095
9257
|
<details>
|
|
9096
9258
|
|
|
9097
|
-
<summary>All
|
|
9259
|
+
<summary>All TypeScript definitions</summary>
|
|
9098
9260
|
|
|
9099
9261
|
```typescript
|
|
9100
9262
|
none<T>(predicate: (x: T) => boolean, list: T[]): boolean;
|
|
@@ -9143,7 +9305,7 @@ test('when false curried', () => {
|
|
|
9143
9305
|
|
|
9144
9306
|
<details>
|
|
9145
9307
|
|
|
9146
|
-
<summary><strong>
|
|
9308
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9147
9309
|
|
|
9148
9310
|
```typescript
|
|
9149
9311
|
import {none} from 'rambda'
|
|
@@ -9186,7 +9348,7 @@ It returns a boolean negated version of `input`.
|
|
|
9186
9348
|
|
|
9187
9349
|
<details>
|
|
9188
9350
|
|
|
9189
|
-
<summary>All
|
|
9351
|
+
<summary>All TypeScript definitions</summary>
|
|
9190
9352
|
|
|
9191
9353
|
```typescript
|
|
9192
9354
|
not(input: any): boolean;
|
|
@@ -9225,7 +9387,7 @@ test('not', () => {
|
|
|
9225
9387
|
|
|
9226
9388
|
<details>
|
|
9227
9389
|
|
|
9228
|
-
<summary><strong>
|
|
9390
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9229
9391
|
|
|
9230
9392
|
```typescript
|
|
9231
9393
|
import {not} from 'rambda'
|
|
@@ -9256,7 +9418,7 @@ Curried version of `input[index]`.
|
|
|
9256
9418
|
|
|
9257
9419
|
<details>
|
|
9258
9420
|
|
|
9259
|
-
<summary>All
|
|
9421
|
+
<summary>All TypeScript definitions</summary>
|
|
9260
9422
|
|
|
9261
9423
|
```typescript
|
|
9262
9424
|
nth(index: number, input: string): string;
|
|
@@ -9319,7 +9481,7 @@ test('with negative index', () => {
|
|
|
9319
9481
|
|
|
9320
9482
|
<details>
|
|
9321
9483
|
|
|
9322
|
-
<summary><strong>
|
|
9484
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9323
9485
|
|
|
9324
9486
|
```typescript
|
|
9325
9487
|
import {nth} from 'rambda'
|
|
@@ -9377,7 +9539,7 @@ of<T>(x: T): T[]
|
|
|
9377
9539
|
|
|
9378
9540
|
<details>
|
|
9379
9541
|
|
|
9380
|
-
<summary>All
|
|
9542
|
+
<summary>All TypeScript definitions</summary>
|
|
9381
9543
|
|
|
9382
9544
|
```typescript
|
|
9383
9545
|
of<T>(x: T): T[];
|
|
@@ -9415,7 +9577,7 @@ test('happy', () => {
|
|
|
9415
9577
|
|
|
9416
9578
|
<details>
|
|
9417
9579
|
|
|
9418
|
-
<summary><strong>
|
|
9580
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9419
9581
|
|
|
9420
9582
|
```typescript
|
|
9421
9583
|
import {of} from 'rambda'
|
|
@@ -9453,7 +9615,7 @@ It returns a partial copy of an `obj` without `propsToOmit` properties.
|
|
|
9453
9615
|
|
|
9454
9616
|
<details>
|
|
9455
9617
|
|
|
9456
|
-
<summary>All
|
|
9618
|
+
<summary>All TypeScript definitions</summary>
|
|
9457
9619
|
|
|
9458
9620
|
```typescript
|
|
9459
9621
|
omit<T, K extends string>(propsToOmit: K[], obj: T): Omit<T, K>;
|
|
@@ -9543,7 +9705,7 @@ test('happy', () => {
|
|
|
9543
9705
|
|
|
9544
9706
|
<details>
|
|
9545
9707
|
|
|
9546
|
-
<summary><strong>
|
|
9708
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9547
9709
|
|
|
9548
9710
|
```typescript
|
|
9549
9711
|
import {omit} from 'rambda'
|
|
@@ -9654,7 +9816,7 @@ It returns a function, which invokes only once `fn` function.
|
|
|
9654
9816
|
|
|
9655
9817
|
<details>
|
|
9656
9818
|
|
|
9657
|
-
<summary>All
|
|
9819
|
+
<summary>All TypeScript definitions</summary>
|
|
9658
9820
|
|
|
9659
9821
|
```typescript
|
|
9660
9822
|
once<T extends AnyFunction>(func: T): T;
|
|
@@ -9732,7 +9894,7 @@ test('happy path', () => {
|
|
|
9732
9894
|
|
|
9733
9895
|
<details>
|
|
9734
9896
|
|
|
9735
|
-
<summary><strong>
|
|
9897
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9736
9898
|
|
|
9737
9899
|
```typescript
|
|
9738
9900
|
import {once} from 'rambda'
|
|
@@ -9774,7 +9936,7 @@ It returns a copied **Object** or **Array** with modified value received by appl
|
|
|
9774
9936
|
|
|
9775
9937
|
<details>
|
|
9776
9938
|
|
|
9777
|
-
<summary>All
|
|
9939
|
+
<summary>All TypeScript definitions</summary>
|
|
9778
9940
|
|
|
9779
9941
|
```typescript
|
|
9780
9942
|
over<T>(lens: Lens, fn: Arity1Fn, value: T): T;
|
|
@@ -9885,7 +10047,7 @@ The name comes from the fact that you partially inject the inputs.
|
|
|
9885
10047
|
|
|
9886
10048
|
<details>
|
|
9887
10049
|
|
|
9888
|
-
<summary>All
|
|
10050
|
+
<summary>All TypeScript definitions</summary>
|
|
9889
10051
|
|
|
9890
10052
|
```typescript
|
|
9891
10053
|
partial<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: [V0]): (x1: V1) => T;
|
|
@@ -9992,7 +10154,7 @@ test('ramda spec', () => {
|
|
|
9992
10154
|
|
|
9993
10155
|
<details>
|
|
9994
10156
|
|
|
9995
|
-
<summary><strong>
|
|
10157
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
9996
10158
|
|
|
9997
10159
|
```typescript
|
|
9998
10160
|
import {partial} from 'rambda'
|
|
@@ -10038,7 +10200,7 @@ Initially the function knows only a part from the whole input object and then `R
|
|
|
10038
10200
|
|
|
10039
10201
|
<details>
|
|
10040
10202
|
|
|
10041
|
-
<summary>All
|
|
10203
|
+
<summary>All TypeScript definitions</summary>
|
|
10042
10204
|
|
|
10043
10205
|
```typescript
|
|
10044
10206
|
partialObject<Input, PartialInput, Output>(
|
|
@@ -10138,7 +10300,7 @@ test('async function throwing an error', async () => {
|
|
|
10138
10300
|
|
|
10139
10301
|
<details>
|
|
10140
10302
|
|
|
10141
|
-
<summary><strong>
|
|
10303
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10142
10304
|
|
|
10143
10305
|
```typescript
|
|
10144
10306
|
import {partialObject, delay} from 'rambda'
|
|
@@ -10198,7 +10360,7 @@ It will return array of two objects/arrays according to `predicate` function. Th
|
|
|
10198
10360
|
|
|
10199
10361
|
<details>
|
|
10200
10362
|
|
|
10201
|
-
<summary>All
|
|
10363
|
+
<summary>All TypeScript definitions</summary>
|
|
10202
10364
|
|
|
10203
10365
|
```typescript
|
|
10204
10366
|
partition<T>(
|
|
@@ -10348,7 +10510,7 @@ test('readme example', () => {
|
|
|
10348
10510
|
|
|
10349
10511
|
<details>
|
|
10350
10512
|
|
|
10351
|
-
<summary><strong>
|
|
10513
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10352
10514
|
|
|
10353
10515
|
```typescript
|
|
10354
10516
|
import {partition} from 'rambda'
|
|
@@ -10411,7 +10573,7 @@ It will return `undefined`, if such path is not found.
|
|
|
10411
10573
|
|
|
10412
10574
|
<details>
|
|
10413
10575
|
|
|
10414
|
-
<summary>All
|
|
10576
|
+
<summary>All TypeScript definitions</summary>
|
|
10415
10577
|
|
|
10416
10578
|
```typescript
|
|
10417
10579
|
path<S, K0 extends keyof S = keyof S>(path: [K0], obj: S): S[K0];
|
|
@@ -10538,7 +10700,7 @@ test('null is not a valid path', () => {
|
|
|
10538
10700
|
|
|
10539
10701
|
<details>
|
|
10540
10702
|
|
|
10541
|
-
<summary><strong>
|
|
10703
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10542
10704
|
|
|
10543
10705
|
```typescript
|
|
10544
10706
|
import {path} from 'rambda'
|
|
@@ -10618,7 +10780,7 @@ It returns `true` if `pathToSearch` of `input` object is equal to `target` value
|
|
|
10618
10780
|
|
|
10619
10781
|
<details>
|
|
10620
10782
|
|
|
10621
|
-
<summary>All
|
|
10783
|
+
<summary>All TypeScript definitions</summary>
|
|
10622
10784
|
|
|
10623
10785
|
```typescript
|
|
10624
10786
|
pathEq(pathToSearch: Path, target: any, input: any): boolean;
|
|
@@ -10688,7 +10850,7 @@ test('when wrong path', () => {
|
|
|
10688
10850
|
|
|
10689
10851
|
<details>
|
|
10690
10852
|
|
|
10691
|
-
<summary><strong>
|
|
10853
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10692
10854
|
|
|
10693
10855
|
```typescript
|
|
10694
10856
|
import {pathEq} from 'rambda'
|
|
@@ -10752,7 +10914,7 @@ It reads `obj` input and returns either `R.path(pathToSearch, Record<string, unk
|
|
|
10752
10914
|
|
|
10753
10915
|
<details>
|
|
10754
10916
|
|
|
10755
|
-
<summary>All
|
|
10917
|
+
<summary>All TypeScript definitions</summary>
|
|
10756
10918
|
|
|
10757
10919
|
```typescript
|
|
10758
10920
|
pathOr<T>(defaultValue: T, pathToSearch: Path, obj: any): T;
|
|
@@ -10836,7 +10998,7 @@ test('curry case (x,y)(z)', () => {
|
|
|
10836
10998
|
|
|
10837
10999
|
<details>
|
|
10838
11000
|
|
|
10839
|
-
<summary><strong>
|
|
11001
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10840
11002
|
|
|
10841
11003
|
```typescript
|
|
10842
11004
|
import {pathOr} from 'rambda'
|
|
@@ -10880,7 +11042,7 @@ Because it calls `R.path`, then `singlePath` can be either string or a list.
|
|
|
10880
11042
|
|
|
10881
11043
|
<details>
|
|
10882
11044
|
|
|
10883
|
-
<summary>All
|
|
11045
|
+
<summary>All TypeScript definitions</summary>
|
|
10884
11046
|
|
|
10885
11047
|
```typescript
|
|
10886
11048
|
paths<Input, T>(pathsToSearch: Path[], obj: Input): (T | undefined)[];
|
|
@@ -10978,7 +11140,7 @@ test('returns undefined for items not found', () => {
|
|
|
10978
11140
|
|
|
10979
11141
|
<details>
|
|
10980
11142
|
|
|
10981
|
-
<summary><strong>
|
|
11143
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
10982
11144
|
|
|
10983
11145
|
```typescript
|
|
10984
11146
|
import {paths} from 'rambda'
|
|
@@ -11035,7 +11197,7 @@ String annotation of `propsToPick` is one of the differences between `Rambda` an
|
|
|
11035
11197
|
|
|
11036
11198
|
<details>
|
|
11037
11199
|
|
|
11038
|
-
<summary>All
|
|
11200
|
+
<summary>All TypeScript definitions</summary>
|
|
11039
11201
|
|
|
11040
11202
|
```typescript
|
|
11041
11203
|
pick<T, K extends string | number | symbol>(propsToPick: K[], input: T): Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
|
|
@@ -11167,7 +11329,7 @@ test('with symbol', () => {
|
|
|
11167
11329
|
|
|
11168
11330
|
<details>
|
|
11169
11331
|
|
|
11170
|
-
<summary><strong>
|
|
11332
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11171
11333
|
|
|
11172
11334
|
```typescript
|
|
11173
11335
|
import {pick} from 'rambda'
|
|
@@ -11238,7 +11400,7 @@ Same as `R.pick` but it won't skip the missing props, i.e. it will assign them t
|
|
|
11238
11400
|
|
|
11239
11401
|
<details>
|
|
11240
11402
|
|
|
11241
|
-
<summary>All
|
|
11403
|
+
<summary>All TypeScript definitions</summary>
|
|
11242
11404
|
|
|
11243
11405
|
```typescript
|
|
11244
11406
|
pickAll<T, K extends keyof T>(propsToPicks: K[], input: T): Pick<T, K>;
|
|
@@ -11328,7 +11490,7 @@ test('with array as condition', () => {
|
|
|
11328
11490
|
|
|
11329
11491
|
<details>
|
|
11330
11492
|
|
|
11331
|
-
<summary><strong>
|
|
11493
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11332
11494
|
|
|
11333
11495
|
```typescript
|
|
11334
11496
|
import {pickAll} from 'rambda'
|
|
@@ -11409,7 +11571,7 @@ It returns list of the values of `property` taken from the all objects inside `l
|
|
|
11409
11571
|
|
|
11410
11572
|
<details>
|
|
11411
11573
|
|
|
11412
|
-
<summary>All
|
|
11574
|
+
<summary>All TypeScript definitions</summary>
|
|
11413
11575
|
|
|
11414
11576
|
```typescript
|
|
11415
11577
|
pluck<K extends keyof T, T>(property: K, list: T[]): T[K][];
|
|
@@ -11469,7 +11631,7 @@ test('with number', () => {
|
|
|
11469
11631
|
|
|
11470
11632
|
<details>
|
|
11471
11633
|
|
|
11472
|
-
<summary><strong>
|
|
11634
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11473
11635
|
|
|
11474
11636
|
```typescript
|
|
11475
11637
|
import {pluck} from 'rambda'
|
|
@@ -11521,7 +11683,7 @@ It adds element `x` at the beginning of `list`.
|
|
|
11521
11683
|
|
|
11522
11684
|
<details>
|
|
11523
11685
|
|
|
11524
|
-
<summary>All
|
|
11686
|
+
<summary>All TypeScript definitions</summary>
|
|
11525
11687
|
|
|
11526
11688
|
```typescript
|
|
11527
11689
|
prepend<T>(x: T, input: T[]): T[];
|
|
@@ -11575,7 +11737,7 @@ test('with string instead of array', () => {
|
|
|
11575
11737
|
|
|
11576
11738
|
<details>
|
|
11577
11739
|
|
|
11578
|
-
<summary><strong>
|
|
11740
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11579
11741
|
|
|
11580
11742
|
```typescript
|
|
11581
11743
|
import {prepend} from 'rambda'
|
|
@@ -11611,7 +11773,7 @@ product(list: number[]): number
|
|
|
11611
11773
|
|
|
11612
11774
|
<details>
|
|
11613
11775
|
|
|
11614
|
-
<summary>All
|
|
11776
|
+
<summary>All TypeScript definitions</summary>
|
|
11615
11777
|
|
|
11616
11778
|
```typescript
|
|
11617
11779
|
product(list: number[]): number;
|
|
@@ -11653,7 +11815,7 @@ test('bad input', () => {
|
|
|
11653
11815
|
|
|
11654
11816
|
<details>
|
|
11655
11817
|
|
|
11656
|
-
<summary><strong>
|
|
11818
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11657
11819
|
|
|
11658
11820
|
```typescript
|
|
11659
11821
|
import {product} from 'rambda'
|
|
@@ -11675,7 +11837,7 @@ describe('R.product', () => {
|
|
|
11675
11837
|
|
|
11676
11838
|
```typescript
|
|
11677
11839
|
|
|
11678
|
-
prop<P extends keyof never, T>(
|
|
11840
|
+
prop<_, P extends keyof never, T>(p: P, value: T): Prop<T, P>
|
|
11679
11841
|
```
|
|
11680
11842
|
|
|
11681
11843
|
It returns the value of property `propToFind` in `obj`.
|
|
@@ -11686,20 +11848,13 @@ If there is no such property, it returns `undefined`.
|
|
|
11686
11848
|
|
|
11687
11849
|
<details>
|
|
11688
11850
|
|
|
11689
|
-
<summary>All
|
|
11851
|
+
<summary>All TypeScript definitions</summary>
|
|
11690
11852
|
|
|
11691
11853
|
```typescript
|
|
11692
|
-
prop<P extends keyof never, T>(
|
|
11693
|
-
prop<
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
};
|
|
11697
|
-
prop<P extends keyof T, T>(propToFind: P): {
|
|
11698
|
-
(value: T): Prop<T, P>;
|
|
11699
|
-
};
|
|
11700
|
-
prop<P extends keyof never, T>(propToFind: P): {
|
|
11701
|
-
(value: Record<P, T>): T;
|
|
11702
|
-
};
|
|
11854
|
+
prop<_, P extends keyof never, T>(p: P, value: T): Prop<T, P>;
|
|
11855
|
+
prop<V>(p: keyof never, value: unknown): V;
|
|
11856
|
+
prop<_, P extends keyof never>(p: P): <T>(value: T) => Prop<T, P>;
|
|
11857
|
+
prop<V>(p: keyof never): (value: unknown) => V;
|
|
11703
11858
|
```
|
|
11704
11859
|
|
|
11705
11860
|
</details>
|
|
@@ -11740,7 +11895,7 @@ test('prop', () => {
|
|
|
11740
11895
|
|
|
11741
11896
|
<details>
|
|
11742
11897
|
|
|
11743
|
-
<summary><strong>
|
|
11898
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11744
11899
|
|
|
11745
11900
|
```typescript
|
|
11746
11901
|
import {prop} from 'rambda'
|
|
@@ -11803,7 +11958,7 @@ It returns true if `obj` has property `propToFind` and its value is equal to `va
|
|
|
11803
11958
|
|
|
11804
11959
|
<details>
|
|
11805
11960
|
|
|
11806
|
-
<summary>All
|
|
11961
|
+
<summary>All TypeScript definitions</summary>
|
|
11807
11962
|
|
|
11808
11963
|
```typescript
|
|
11809
11964
|
propEq<K extends string | number>(valueToMatch: any, propToFind: K, obj: Record<K, any>): boolean;
|
|
@@ -11870,7 +12025,7 @@ test('returns false if called with a null or undefined object', () => {
|
|
|
11870
12025
|
|
|
11871
12026
|
<details>
|
|
11872
12027
|
|
|
11873
|
-
<summary><strong>
|
|
12028
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
11874
12029
|
|
|
11875
12030
|
```typescript
|
|
11876
12031
|
import {propEq} from 'rambda'
|
|
@@ -11937,7 +12092,7 @@ It returns `true` if `property` of `obj` is from `target` type.
|
|
|
11937
12092
|
|
|
11938
12093
|
<details>
|
|
11939
12094
|
|
|
11940
|
-
<summary>All
|
|
12095
|
+
<summary>All TypeScript definitions</summary>
|
|
11941
12096
|
|
|
11942
12097
|
```typescript
|
|
11943
12098
|
propIs<C extends AnyFunction, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, ReturnType<C>>;
|
|
@@ -12006,7 +12161,7 @@ test('when false', () => {
|
|
|
12006
12161
|
|
|
12007
12162
|
<details>
|
|
12008
12163
|
|
|
12009
|
-
<summary><strong>
|
|
12164
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12010
12165
|
|
|
12011
12166
|
```typescript
|
|
12012
12167
|
import {propIs} from 'rambda'
|
|
@@ -12044,7 +12199,7 @@ It returns either `defaultValue` or the value of `property` in `obj`.
|
|
|
12044
12199
|
|
|
12045
12200
|
<details>
|
|
12046
12201
|
|
|
12047
|
-
<summary>All
|
|
12202
|
+
<summary>All TypeScript definitions</summary>
|
|
12048
12203
|
|
|
12049
12204
|
```typescript
|
|
12050
12205
|
propOr<T, P extends string>(defaultValue: T, property: P, obj: Partial<Record<P, T>> | undefined): T;
|
|
@@ -12111,7 +12266,7 @@ test('propOr (currying)', () => {
|
|
|
12111
12266
|
|
|
12112
12267
|
<details>
|
|
12113
12268
|
|
|
12114
|
-
<summary><strong>
|
|
12269
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12115
12270
|
|
|
12116
12271
|
```typescript
|
|
12117
12272
|
import {propOr} from 'rambda'
|
|
@@ -12157,7 +12312,7 @@ It takes list with properties `propsToPick` and returns a list with property val
|
|
|
12157
12312
|
|
|
12158
12313
|
<details>
|
|
12159
12314
|
|
|
12160
|
-
<summary>All
|
|
12315
|
+
<summary>All TypeScript definitions</summary>
|
|
12161
12316
|
|
|
12162
12317
|
```typescript
|
|
12163
12318
|
props<P extends string, T>(propsToPick: P[], obj: Record<P, T>): T[];
|
|
@@ -12221,7 +12376,7 @@ test('wrong input', () => {
|
|
|
12221
12376
|
|
|
12222
12377
|
<details>
|
|
12223
12378
|
|
|
12224
|
-
<summary><strong>
|
|
12379
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12225
12380
|
|
|
12226
12381
|
```typescript
|
|
12227
12382
|
import {props} from 'rambda'
|
|
@@ -12259,7 +12414,7 @@ It returns `true` if the object property satisfies a given predicate.
|
|
|
12259
12414
|
|
|
12260
12415
|
<details>
|
|
12261
12416
|
|
|
12262
|
-
<summary>All
|
|
12417
|
+
<summary>All TypeScript definitions</summary>
|
|
12263
12418
|
|
|
12264
12419
|
```typescript
|
|
12265
12420
|
propSatisfies<T>(predicate: Predicate<T>, property: string, obj: Record<string, T>): boolean;
|
|
@@ -12311,7 +12466,7 @@ test('when false', () => {
|
|
|
12311
12466
|
|
|
12312
12467
|
<details>
|
|
12313
12468
|
|
|
12314
|
-
<summary><strong>
|
|
12469
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12315
12470
|
|
|
12316
12471
|
```typescript
|
|
12317
12472
|
import {propSatisfies} from 'rambda'
|
|
@@ -12349,7 +12504,7 @@ It returns list of numbers between `startInclusive` to `endExclusive` markers.
|
|
|
12349
12504
|
|
|
12350
12505
|
<details>
|
|
12351
12506
|
|
|
12352
|
-
<summary>All
|
|
12507
|
+
<summary>All TypeScript definitions</summary>
|
|
12353
12508
|
|
|
12354
12509
|
```typescript
|
|
12355
12510
|
range(startInclusive: number, endExclusive: number): number[];
|
|
@@ -12416,7 +12571,7 @@ test('curry', () => {
|
|
|
12416
12571
|
|
|
12417
12572
|
<details>
|
|
12418
12573
|
|
|
12419
|
-
<summary><strong>
|
|
12574
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12420
12575
|
|
|
12421
12576
|
```typescript
|
|
12422
12577
|
import {range} from 'rambda'
|
|
@@ -12458,7 +12613,7 @@ It has the opposite effect of `R.filter`.
|
|
|
12458
12613
|
|
|
12459
12614
|
<details>
|
|
12460
12615
|
|
|
12461
|
-
<summary>All
|
|
12616
|
+
<summary>All TypeScript definitions</summary>
|
|
12462
12617
|
|
|
12463
12618
|
```typescript
|
|
12464
12619
|
reject<T>(predicate: Predicate<T>, list: T[]): T[];
|
|
@@ -12516,7 +12671,7 @@ test('with object', () => {
|
|
|
12516
12671
|
|
|
12517
12672
|
<details>
|
|
12518
12673
|
|
|
12519
|
-
<summary><strong>
|
|
12674
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12520
12675
|
|
|
12521
12676
|
```typescript
|
|
12522
12677
|
import {reject} from 'rambda'
|
|
@@ -12577,7 +12732,7 @@ repeat<T>(x: T): (timesToRepeat: number) => T[]
|
|
|
12577
12732
|
|
|
12578
12733
|
<details>
|
|
12579
12734
|
|
|
12580
|
-
<summary>All
|
|
12735
|
+
<summary>All TypeScript definitions</summary>
|
|
12581
12736
|
|
|
12582
12737
|
```typescript
|
|
12583
12738
|
repeat<T>(x: T): (timesToRepeat: number) => T[];
|
|
@@ -12626,7 +12781,7 @@ test('repeat', () => {
|
|
|
12626
12781
|
|
|
12627
12782
|
<details>
|
|
12628
12783
|
|
|
12629
|
-
<summary><strong>
|
|
12784
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12630
12785
|
|
|
12631
12786
|
```typescript
|
|
12632
12787
|
import {repeat} from 'rambda'
|
|
@@ -12662,7 +12817,7 @@ It replaces `strOrRegex` found in `str` with `replacer`.
|
|
|
12662
12817
|
|
|
12663
12818
|
<details>
|
|
12664
12819
|
|
|
12665
|
-
<summary>All
|
|
12820
|
+
<summary>All TypeScript definitions</summary>
|
|
12666
12821
|
|
|
12667
12822
|
```typescript
|
|
12668
12823
|
replace(strOrRegex: RegExp | string, replacer: RegExpReplacer, str: string): string;
|
|
@@ -12724,7 +12879,7 @@ test('with function as replacer input', () => {
|
|
|
12724
12879
|
|
|
12725
12880
|
<details>
|
|
12726
12881
|
|
|
12727
|
-
<summary><strong>
|
|
12882
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12728
12883
|
|
|
12729
12884
|
```typescript
|
|
12730
12885
|
import {replace} from 'rambda'
|
|
@@ -12796,7 +12951,7 @@ It returns a reversed copy of list or string `input`.
|
|
|
12796
12951
|
|
|
12797
12952
|
<details>
|
|
12798
12953
|
|
|
12799
|
-
<summary>All
|
|
12954
|
+
<summary>All TypeScript definitions</summary>
|
|
12800
12955
|
|
|
12801
12956
|
```typescript
|
|
12802
12957
|
reverse<T>(input: T[]): T[];
|
|
@@ -12851,7 +13006,7 @@ test("it doesn't mutate", () => {
|
|
|
12851
13006
|
|
|
12852
13007
|
<details>
|
|
12853
13008
|
|
|
12854
|
-
<summary><strong>
|
|
13009
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
12855
13010
|
|
|
12856
13011
|
```typescript
|
|
12857
13012
|
import {reverse} from 'rambda'
|
|
@@ -12883,7 +13038,7 @@ It returns a copied **Object** or **Array** with modified `lens` focus set to `r
|
|
|
12883
13038
|
|
|
12884
13039
|
<details>
|
|
12885
13040
|
|
|
12886
|
-
<summary>All
|
|
13041
|
+
<summary>All TypeScript definitions</summary>
|
|
12887
13042
|
|
|
12888
13043
|
```typescript
|
|
12889
13044
|
set<T, U>(lens: Lens, replacer: U, obj: T): T;
|
|
@@ -12977,7 +13132,7 @@ slice(from: number, to: number, input: string): string
|
|
|
12977
13132
|
|
|
12978
13133
|
<details>
|
|
12979
13134
|
|
|
12980
|
-
<summary>All
|
|
13135
|
+
<summary>All TypeScript definitions</summary>
|
|
12981
13136
|
|
|
12982
13137
|
```typescript
|
|
12983
13138
|
slice(from: number, to: number, input: string): string;
|
|
@@ -13042,7 +13197,7 @@ test('slice', () => {
|
|
|
13042
13197
|
|
|
13043
13198
|
<details>
|
|
13044
13199
|
|
|
13045
|
-
<summary><strong>
|
|
13200
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13046
13201
|
|
|
13047
13202
|
```typescript
|
|
13048
13203
|
import {slice} from 'rambda'
|
|
@@ -13078,7 +13233,7 @@ It returns copy of `list` sorted by `sortFn` function, where `sortFn` needs to r
|
|
|
13078
13233
|
|
|
13079
13234
|
<details>
|
|
13080
13235
|
|
|
13081
|
-
<summary>All
|
|
13236
|
+
<summary>All TypeScript definitions</summary>
|
|
13082
13237
|
|
|
13083
13238
|
```typescript
|
|
13084
13239
|
sort<T>(sortFn: (a: T, b: T) => number, list: T[]): T[];
|
|
@@ -13131,7 +13286,7 @@ test('it doesn\'t mutate', () => {
|
|
|
13131
13286
|
|
|
13132
13287
|
<details>
|
|
13133
13288
|
|
|
13134
|
-
<summary><strong>
|
|
13289
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13135
13290
|
|
|
13136
13291
|
```typescript
|
|
13137
13292
|
import {sort} from 'rambda'
|
|
@@ -13171,7 +13326,7 @@ It returns copy of `list` sorted by `sortFn` function, where `sortFn` function r
|
|
|
13171
13326
|
|
|
13172
13327
|
<details>
|
|
13173
13328
|
|
|
13174
|
-
<summary>All
|
|
13329
|
+
<summary>All TypeScript definitions</summary>
|
|
13175
13330
|
|
|
13176
13331
|
```typescript
|
|
13177
13332
|
sortBy<T>(sortFn: (a: T) => Ord, list: T[]): T[];
|
|
@@ -13248,7 +13403,7 @@ test('with compose', () => {
|
|
|
13248
13403
|
|
|
13249
13404
|
<details>
|
|
13250
13405
|
|
|
13251
|
-
<summary><strong>
|
|
13406
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13252
13407
|
|
|
13253
13408
|
```typescript
|
|
13254
13409
|
import {sortBy, pipe} from 'rambda'
|
|
@@ -13317,7 +13472,7 @@ Curried version of `String.prototype.split`
|
|
|
13317
13472
|
|
|
13318
13473
|
<details>
|
|
13319
13474
|
|
|
13320
|
-
<summary>All
|
|
13475
|
+
<summary>All TypeScript definitions</summary>
|
|
13321
13476
|
|
|
13322
13477
|
```typescript
|
|
13323
13478
|
split(separator: string | RegExp): (str: string) => string[];
|
|
@@ -13364,7 +13519,7 @@ test('curried', () => {
|
|
|
13364
13519
|
|
|
13365
13520
|
<details>
|
|
13366
13521
|
|
|
13367
|
-
<summary><strong>
|
|
13522
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13368
13523
|
|
|
13369
13524
|
```typescript
|
|
13370
13525
|
import {split} from 'rambda'
|
|
@@ -13403,7 +13558,7 @@ It splits string or array at a given index.
|
|
|
13403
13558
|
|
|
13404
13559
|
<details>
|
|
13405
13560
|
|
|
13406
|
-
<summary>All
|
|
13561
|
+
<summary>All TypeScript definitions</summary>
|
|
13407
13562
|
|
|
13408
13563
|
```typescript
|
|
13409
13564
|
splitAt<T>(index: number, input: T[]): [T[], T[]];
|
|
@@ -13516,7 +13671,7 @@ test('with bad inputs', () => {
|
|
|
13516
13671
|
|
|
13517
13672
|
<details>
|
|
13518
13673
|
|
|
13519
|
-
<summary><strong>
|
|
13674
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13520
13675
|
|
|
13521
13676
|
```typescript
|
|
13522
13677
|
import {splitAt} from 'rambda'
|
|
@@ -13569,7 +13724,7 @@ It splits `input` into slices of `sliceLength`.
|
|
|
13569
13724
|
|
|
13570
13725
|
<details>
|
|
13571
13726
|
|
|
13572
|
-
<summary>All
|
|
13727
|
+
<summary>All TypeScript definitions</summary>
|
|
13573
13728
|
|
|
13574
13729
|
```typescript
|
|
13575
13730
|
splitEvery<T>(sliceLength: number, input: T[]): (T[])[];
|
|
@@ -13636,7 +13791,7 @@ test('with bad input', () => {
|
|
|
13636
13791
|
|
|
13637
13792
|
<details>
|
|
13638
13793
|
|
|
13639
|
-
<summary><strong>
|
|
13794
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13640
13795
|
|
|
13641
13796
|
```typescript
|
|
13642
13797
|
import {splitEvery} from 'rambda'
|
|
@@ -13676,7 +13831,7 @@ The first array contains all members of `list` before `predicate` returns `true`
|
|
|
13676
13831
|
|
|
13677
13832
|
<details>
|
|
13678
13833
|
|
|
13679
|
-
<summary>All
|
|
13834
|
+
<summary>All TypeScript definitions</summary>
|
|
13680
13835
|
|
|
13681
13836
|
```typescript
|
|
13682
13837
|
splitWhen<T, U>(predicate: Predicate<T>, list: U[]): (U[])[];
|
|
@@ -13764,7 +13919,7 @@ test('with bad inputs', () => {
|
|
|
13764
13919
|
|
|
13765
13920
|
<details>
|
|
13766
13921
|
|
|
13767
|
-
<summary><strong>
|
|
13922
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13768
13923
|
|
|
13769
13924
|
```typescript
|
|
13770
13925
|
import {splitWhen} from 'rambda'
|
|
@@ -13804,7 +13959,7 @@ When iterable is a list, then it uses R.equals to determine if the target list s
|
|
|
13804
13959
|
|
|
13805
13960
|
<details>
|
|
13806
13961
|
|
|
13807
|
-
<summary>All
|
|
13962
|
+
<summary>All TypeScript definitions</summary>
|
|
13808
13963
|
|
|
13809
13964
|
```typescript
|
|
13810
13965
|
startsWith<T extends string>(question: T, input: string): boolean;
|
|
@@ -13898,7 +14053,7 @@ describe('brute force', () => {
|
|
|
13898
14053
|
|
|
13899
14054
|
<details>
|
|
13900
14055
|
|
|
13901
|
-
<summary><strong>
|
|
14056
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
13902
14057
|
|
|
13903
14058
|
```typescript
|
|
13904
14059
|
import {startsWith} from 'rambda'
|
|
@@ -13953,7 +14108,7 @@ sum(list: number[]): number
|
|
|
13953
14108
|
|
|
13954
14109
|
<details>
|
|
13955
14110
|
|
|
13956
|
-
<summary>All
|
|
14111
|
+
<summary>All TypeScript definitions</summary>
|
|
13957
14112
|
|
|
13958
14113
|
```typescript
|
|
13959
14114
|
sum(list: number[]): number;
|
|
@@ -14004,7 +14159,7 @@ It returns a merged list of `x` and `y` with all equal elements removed.
|
|
|
14004
14159
|
|
|
14005
14160
|
<details>
|
|
14006
14161
|
|
|
14007
|
-
<summary>All
|
|
14162
|
+
<summary>All TypeScript definitions</summary>
|
|
14008
14163
|
|
|
14009
14164
|
```typescript
|
|
14010
14165
|
symmetricDifference<T>(x: T[], y: T[]): T[];
|
|
@@ -14065,7 +14220,7 @@ test('symmetricDifference with objects', () => {
|
|
|
14065
14220
|
|
|
14066
14221
|
<details>
|
|
14067
14222
|
|
|
14068
|
-
<summary><strong>
|
|
14223
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14069
14224
|
|
|
14070
14225
|
```typescript
|
|
14071
14226
|
import {symmetricDifference} from 'rambda'
|
|
@@ -14104,7 +14259,7 @@ T(): boolean
|
|
|
14104
14259
|
|
|
14105
14260
|
<details>
|
|
14106
14261
|
|
|
14107
|
-
<summary>All
|
|
14262
|
+
<summary>All TypeScript definitions</summary>
|
|
14108
14263
|
|
|
14109
14264
|
```typescript
|
|
14110
14265
|
T(): boolean;
|
|
@@ -14139,7 +14294,7 @@ It returns all but the first element of `input`.
|
|
|
14139
14294
|
|
|
14140
14295
|
<details>
|
|
14141
14296
|
|
|
14142
|
-
<summary>All
|
|
14297
|
+
<summary>All TypeScript definitions</summary>
|
|
14143
14298
|
|
|
14144
14299
|
```typescript
|
|
14145
14300
|
tail<T extends unknown[]>(input: T): T extends [any, ...infer U] ? U : [...T];
|
|
@@ -14186,7 +14341,7 @@ test('tail', () => {
|
|
|
14186
14341
|
|
|
14187
14342
|
<details>
|
|
14188
14343
|
|
|
14189
|
-
<summary><strong>
|
|
14344
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14190
14345
|
|
|
14191
14346
|
```typescript
|
|
14192
14347
|
import {tail} from 'rambda'
|
|
@@ -14227,7 +14382,7 @@ It returns the first `howMany` elements of `input`.
|
|
|
14227
14382
|
|
|
14228
14383
|
<details>
|
|
14229
14384
|
|
|
14230
|
-
<summary>All
|
|
14385
|
+
<summary>All TypeScript definitions</summary>
|
|
14231
14386
|
|
|
14232
14387
|
```typescript
|
|
14233
14388
|
take<T>(howMany: number, input: T[]): T[];
|
|
@@ -14295,7 +14450,7 @@ test('with zero index', () => {
|
|
|
14295
14450
|
|
|
14296
14451
|
<details>
|
|
14297
14452
|
|
|
14298
|
-
<summary><strong>
|
|
14453
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14299
14454
|
|
|
14300
14455
|
```typescript
|
|
14301
14456
|
import {take} from 'rambda'
|
|
@@ -14348,7 +14503,7 @@ It returns the last `howMany` elements of `input`.
|
|
|
14348
14503
|
|
|
14349
14504
|
<details>
|
|
14350
14505
|
|
|
14351
|
-
<summary>All
|
|
14506
|
+
<summary>All TypeScript definitions</summary>
|
|
14352
14507
|
|
|
14353
14508
|
```typescript
|
|
14354
14509
|
takeLast<T>(howMany: number, input: T[]): T[];
|
|
@@ -14424,7 +14579,7 @@ test('with negative index', () => {
|
|
|
14424
14579
|
|
|
14425
14580
|
<details>
|
|
14426
14581
|
|
|
14427
|
-
<summary><strong>
|
|
14582
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14428
14583
|
|
|
14429
14584
|
```typescript
|
|
14430
14585
|
import {takeLast} from 'rambda'
|
|
@@ -14475,7 +14630,7 @@ takeLastWhile(predicate: (x: string) => boolean, input: string): string
|
|
|
14475
14630
|
|
|
14476
14631
|
<details>
|
|
14477
14632
|
|
|
14478
|
-
<summary>All
|
|
14633
|
+
<summary>All TypeScript definitions</summary>
|
|
14479
14634
|
|
|
14480
14635
|
```typescript
|
|
14481
14636
|
takeLastWhile(predicate: (x: string) => boolean, input: string): string;
|
|
@@ -14554,7 +14709,7 @@ test('with string', () => {
|
|
|
14554
14709
|
|
|
14555
14710
|
<details>
|
|
14556
14711
|
|
|
14557
|
-
<summary><strong>
|
|
14712
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14558
14713
|
|
|
14559
14714
|
```typescript
|
|
14560
14715
|
import {takeLastWhile} from 'rambda'
|
|
@@ -14611,7 +14766,7 @@ One use case is debugging in the middle of `R.compose`.
|
|
|
14611
14766
|
|
|
14612
14767
|
<details>
|
|
14613
14768
|
|
|
14614
|
-
<summary>All
|
|
14769
|
+
<summary>All TypeScript definitions</summary>
|
|
14615
14770
|
|
|
14616
14771
|
```typescript
|
|
14617
14772
|
tap<T>(fn: (x: T) => void, input: T): T;
|
|
@@ -14657,7 +14812,7 @@ test('tap', () => {
|
|
|
14657
14812
|
|
|
14658
14813
|
<details>
|
|
14659
14814
|
|
|
14660
|
-
<summary><strong>
|
|
14815
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14661
14816
|
|
|
14662
14817
|
```typescript
|
|
14663
14818
|
import {tap, pipe} from 'rambda'
|
|
@@ -14691,7 +14846,7 @@ It determines whether `str` matches `regExpression`.
|
|
|
14691
14846
|
|
|
14692
14847
|
<details>
|
|
14693
14848
|
|
|
14694
|
-
<summary>All
|
|
14849
|
+
<summary>All TypeScript definitions</summary>
|
|
14695
14850
|
|
|
14696
14851
|
```typescript
|
|
14697
14852
|
test(regExpression: RegExp): (str: string) => boolean;
|
|
@@ -14740,7 +14895,7 @@ test('throws if first argument is not regex', () => {
|
|
|
14740
14895
|
|
|
14741
14896
|
<details>
|
|
14742
14897
|
|
|
14743
|
-
<summary><strong>
|
|
14898
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14744
14899
|
|
|
14745
14900
|
```typescript
|
|
14746
14901
|
import {test} from 'rambda'
|
|
@@ -14781,7 +14936,7 @@ The range array includes numbers between `0` and `howMany`(exclusive).
|
|
|
14781
14936
|
|
|
14782
14937
|
<details>
|
|
14783
14938
|
|
|
14784
|
-
<summary>All
|
|
14939
|
+
<summary>All TypeScript definitions</summary>
|
|
14785
14940
|
|
|
14786
14941
|
```typescript
|
|
14787
14942
|
times<T>(fn: (i: number) => T, howMany: number): T[];
|
|
@@ -14847,7 +15002,7 @@ test('curry', () => {
|
|
|
14847
15002
|
|
|
14848
15003
|
<details>
|
|
14849
15004
|
|
|
14850
|
-
<summary><strong>
|
|
15005
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14851
15006
|
|
|
14852
15007
|
```typescript
|
|
14853
15008
|
import {times, identity} from 'rambda'
|
|
@@ -14875,7 +15030,7 @@ toLower<S extends string>(str: S): Lowercase<S>
|
|
|
14875
15030
|
|
|
14876
15031
|
<details>
|
|
14877
15032
|
|
|
14878
|
-
<summary>All
|
|
15033
|
+
<summary>All TypeScript definitions</summary>
|
|
14879
15034
|
|
|
14880
15035
|
```typescript
|
|
14881
15036
|
toLower<S extends string>(str: S): Lowercase<S>;
|
|
@@ -14925,7 +15080,7 @@ It transforms an object to a list.
|
|
|
14925
15080
|
|
|
14926
15081
|
<details>
|
|
14927
15082
|
|
|
14928
|
-
<summary>All
|
|
15083
|
+
<summary>All TypeScript definitions</summary>
|
|
14929
15084
|
|
|
14930
15085
|
```typescript
|
|
14931
15086
|
toPairs<O extends object, K extends Extract<keyof O, string | number>>(obj: O): Array<{ [key in K]: [`${key}`, O[key]] }[K]>;
|
|
@@ -14973,7 +15128,7 @@ test('happy', () => {
|
|
|
14973
15128
|
|
|
14974
15129
|
<details>
|
|
14975
15130
|
|
|
14976
|
-
<summary><strong>
|
|
15131
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
14977
15132
|
|
|
14978
15133
|
```typescript
|
|
14979
15134
|
import {toPairs} from 'rambda'
|
|
@@ -15008,7 +15163,7 @@ toString(x: unknown): string
|
|
|
15008
15163
|
|
|
15009
15164
|
<details>
|
|
15010
15165
|
|
|
15011
|
-
<summary>All
|
|
15166
|
+
<summary>All TypeScript definitions</summary>
|
|
15012
15167
|
|
|
15013
15168
|
```typescript
|
|
15014
15169
|
toString(x: unknown): string;
|
|
@@ -15055,7 +15210,7 @@ toUpper<S extends string>(str: S): Uppercase<S>
|
|
|
15055
15210
|
|
|
15056
15211
|
<details>
|
|
15057
15212
|
|
|
15058
|
-
<summary>All
|
|
15213
|
+
<summary>All TypeScript definitions</summary>
|
|
15059
15214
|
|
|
15060
15215
|
```typescript
|
|
15061
15216
|
toUpper<S extends string>(str: S): Uppercase<S>;
|
|
@@ -15103,7 +15258,7 @@ transpose<T>(list: (T[])[]): (T[])[]
|
|
|
15103
15258
|
|
|
15104
15259
|
<details>
|
|
15105
15260
|
|
|
15106
|
-
<summary>All
|
|
15261
|
+
<summary>All TypeScript definitions</summary>
|
|
15107
15262
|
|
|
15108
15263
|
```typescript
|
|
15109
15264
|
transpose<T>(list: (T[])[]): (T[])[];
|
|
@@ -15179,7 +15334,7 @@ test('array with falsy values', () => {
|
|
|
15179
15334
|
|
|
15180
15335
|
<details>
|
|
15181
15336
|
|
|
15182
|
-
<summary><strong>
|
|
15337
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15183
15338
|
|
|
15184
15339
|
```typescript
|
|
15185
15340
|
import {transpose} from 'rambda'
|
|
@@ -15214,7 +15369,7 @@ trim(str: string): string
|
|
|
15214
15369
|
|
|
15215
15370
|
<details>
|
|
15216
15371
|
|
|
15217
|
-
<summary>All
|
|
15372
|
+
<summary>All TypeScript definitions</summary>
|
|
15218
15373
|
|
|
15219
15374
|
```typescript
|
|
15220
15375
|
trim(str: string): string;
|
|
@@ -15281,7 +15436,7 @@ It calls a function `fn` with the list of values of the returned function.
|
|
|
15281
15436
|
|
|
15282
15437
|
<details>
|
|
15283
15438
|
|
|
15284
|
-
<summary>All
|
|
15439
|
+
<summary>All TypeScript definitions</summary>
|
|
15285
15440
|
|
|
15286
15441
|
```typescript
|
|
15287
15442
|
unapply<T = any>(fn: (args: any[]) => T): (...args: any[]) => T;
|
|
@@ -15404,7 +15559,7 @@ test('it works with converge', () => {
|
|
|
15404
15559
|
|
|
15405
15560
|
<details>
|
|
15406
15561
|
|
|
15407
|
-
<summary><strong>
|
|
15562
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15408
15563
|
|
|
15409
15564
|
```typescript
|
|
15410
15565
|
import {join, unapply, sum} from 'rambda'
|
|
@@ -15443,7 +15598,7 @@ It takes two lists and return a new list containing a merger of both list with r
|
|
|
15443
15598
|
|
|
15444
15599
|
<details>
|
|
15445
15600
|
|
|
15446
|
-
<summary>All
|
|
15601
|
+
<summary>All TypeScript definitions</summary>
|
|
15447
15602
|
|
|
15448
15603
|
```typescript
|
|
15449
15604
|
union<T>(x: T[], y: T[]): T[];
|
|
@@ -15497,7 +15652,7 @@ test('with list of objects', () => {
|
|
|
15497
15652
|
|
|
15498
15653
|
<details>
|
|
15499
15654
|
|
|
15500
|
-
<summary><strong>
|
|
15655
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15501
15656
|
|
|
15502
15657
|
```typescript
|
|
15503
15658
|
import {union} from 'rambda'
|
|
@@ -15564,7 +15719,7 @@ It returns a new array containing only one copy of each element of `list`.
|
|
|
15564
15719
|
|
|
15565
15720
|
<details>
|
|
15566
15721
|
|
|
15567
|
-
<summary>All
|
|
15722
|
+
<summary>All TypeScript definitions</summary>
|
|
15568
15723
|
|
|
15569
15724
|
```typescript
|
|
15570
15725
|
uniq<T>(list: T[]): T[];
|
|
@@ -15632,7 +15787,7 @@ test('can distinct between string and number', () => {
|
|
|
15632
15787
|
|
|
15633
15788
|
<details>
|
|
15634
15789
|
|
|
15635
|
-
<summary><strong>
|
|
15790
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15636
15791
|
|
|
15637
15792
|
```typescript
|
|
15638
15793
|
import {uniq} from 'rambda'
|
|
@@ -15674,7 +15829,7 @@ This predicate should return true, if two elements are equal.
|
|
|
15674
15829
|
|
|
15675
15830
|
<details>
|
|
15676
15831
|
|
|
15677
|
-
<summary>All
|
|
15832
|
+
<summary>All TypeScript definitions</summary>
|
|
15678
15833
|
|
|
15679
15834
|
```typescript
|
|
15680
15835
|
uniqWith<T, U>(predicate: (x: T, y: T) => boolean, list: T[]): T[];
|
|
@@ -15759,7 +15914,7 @@ test('with list of strings', () => {
|
|
|
15759
15914
|
|
|
15760
15915
|
<details>
|
|
15761
15916
|
|
|
15762
|
-
<summary><strong>
|
|
15917
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15763
15918
|
|
|
15764
15919
|
```typescript
|
|
15765
15920
|
import {uniqWith} from 'rambda'
|
|
@@ -15797,7 +15952,7 @@ In the other case, the final output will be the `input` itself.
|
|
|
15797
15952
|
|
|
15798
15953
|
<details>
|
|
15799
15954
|
|
|
15800
|
-
<summary>All
|
|
15955
|
+
<summary>All TypeScript definitions</summary>
|
|
15801
15956
|
|
|
15802
15957
|
```typescript
|
|
15803
15958
|
unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U, x: T): T | U;
|
|
@@ -15849,7 +16004,7 @@ test('curried', () => {
|
|
|
15849
16004
|
|
|
15850
16005
|
<details>
|
|
15851
16006
|
|
|
15852
|
-
<summary><strong>
|
|
16007
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
15853
16008
|
|
|
15854
16009
|
```typescript
|
|
15855
16010
|
import {unless, inc} from 'rambda'
|
|
@@ -15954,7 +16109,7 @@ It returns a copy of `list` with updated element at `index` with `newValue`.
|
|
|
15954
16109
|
|
|
15955
16110
|
<details>
|
|
15956
16111
|
|
|
15957
|
-
<summary>All
|
|
16112
|
+
<summary>All TypeScript definitions</summary>
|
|
15958
16113
|
|
|
15959
16114
|
```typescript
|
|
15960
16115
|
update<T>(index: number, newValue: T, list: T[]): T[];
|
|
@@ -16044,7 +16199,7 @@ test('with negative index', () => {
|
|
|
16044
16199
|
|
|
16045
16200
|
<details>
|
|
16046
16201
|
|
|
16047
|
-
<summary><strong>
|
|
16202
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16048
16203
|
|
|
16049
16204
|
```typescript
|
|
16050
16205
|
import {update} from 'rambda'
|
|
@@ -16074,7 +16229,7 @@ With correct input, this is nothing more than `Object.values(Record<string, unkn
|
|
|
16074
16229
|
|
|
16075
16230
|
<details>
|
|
16076
16231
|
|
|
16077
|
-
<summary>All
|
|
16232
|
+
<summary>All TypeScript definitions</summary>
|
|
16078
16233
|
|
|
16079
16234
|
```typescript
|
|
16080
16235
|
values<T extends object, K extends keyof T>(obj: T): T[K][];
|
|
@@ -16130,7 +16285,7 @@ test('with bad input', () => {
|
|
|
16130
16285
|
|
|
16131
16286
|
<details>
|
|
16132
16287
|
|
|
16133
|
-
<summary><strong>
|
|
16288
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16134
16289
|
|
|
16135
16290
|
```typescript
|
|
16136
16291
|
import {values} from 'rambda'
|
|
@@ -16164,7 +16319,7 @@ It returns the value of `lens` focus over `target` object.
|
|
|
16164
16319
|
|
|
16165
16320
|
<details>
|
|
16166
16321
|
|
|
16167
|
-
<summary>All
|
|
16322
|
+
<summary>All TypeScript definitions</summary>
|
|
16168
16323
|
|
|
16169
16324
|
```typescript
|
|
16170
16325
|
view<T, U>(lens: Lens): (target: T) => U;
|
|
@@ -16214,7 +16369,7 @@ test('happy', () => {
|
|
|
16214
16369
|
|
|
16215
16370
|
<details>
|
|
16216
16371
|
|
|
16217
|
-
<summary><strong>
|
|
16372
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16218
16373
|
|
|
16219
16374
|
```typescript
|
|
16220
16375
|
import {lens, view, assoc} from 'rambda'
|
|
@@ -16252,7 +16407,7 @@ when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U, input: T): T |
|
|
|
16252
16407
|
|
|
16253
16408
|
<details>
|
|
16254
16409
|
|
|
16255
|
-
<summary>All
|
|
16410
|
+
<summary>All TypeScript definitions</summary>
|
|
16256
16411
|
|
|
16257
16412
|
```typescript
|
|
16258
16413
|
when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U, input: T): T | U;
|
|
@@ -16303,7 +16458,7 @@ test('happy', () => {
|
|
|
16303
16458
|
|
|
16304
16459
|
<details>
|
|
16305
16460
|
|
|
16306
|
-
<summary><strong>
|
|
16461
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16307
16462
|
|
|
16308
16463
|
```typescript
|
|
16309
16464
|
import {when} from 'rambda'
|
|
@@ -16348,7 +16503,7 @@ It returns `true` if all each property in `conditions` returns `true` when appli
|
|
|
16348
16503
|
|
|
16349
16504
|
<details>
|
|
16350
16505
|
|
|
16351
|
-
<summary>All
|
|
16506
|
+
<summary>All TypeScript definitions</summary>
|
|
16352
16507
|
|
|
16353
16508
|
```typescript
|
|
16354
16509
|
where<T, U>(conditions: T, input: U): boolean;
|
|
@@ -16430,7 +16585,7 @@ test('when false | early exit', () => {
|
|
|
16430
16585
|
|
|
16431
16586
|
<details>
|
|
16432
16587
|
|
|
16433
|
-
<summary><strong>
|
|
16588
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16434
16589
|
|
|
16435
16590
|
```typescript
|
|
16436
16591
|
import {where, equals} from 'rambda'
|
|
@@ -16482,7 +16637,7 @@ It will return `true` if all of `input` object fully or partially include `rule`
|
|
|
16482
16637
|
|
|
16483
16638
|
<details>
|
|
16484
16639
|
|
|
16485
|
-
<summary>All
|
|
16640
|
+
<summary>All TypeScript definitions</summary>
|
|
16486
16641
|
|
|
16487
16642
|
```typescript
|
|
16488
16643
|
whereEq<T, U>(condition: T, input: U): boolean;
|
|
@@ -16568,7 +16723,7 @@ test('with wrong input', () => {
|
|
|
16568
16723
|
|
|
16569
16724
|
<details>
|
|
16570
16725
|
|
|
16571
|
-
<summary><strong>
|
|
16726
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16572
16727
|
|
|
16573
16728
|
```typescript
|
|
16574
16729
|
import {whereEq} from 'rambda'
|
|
@@ -16602,7 +16757,7 @@ It will return a new array, based on all members of `source` list that are not p
|
|
|
16602
16757
|
|
|
16603
16758
|
<details>
|
|
16604
16759
|
|
|
16605
|
-
<summary>All
|
|
16760
|
+
<summary>All TypeScript definitions</summary>
|
|
16606
16761
|
|
|
16607
16762
|
```typescript
|
|
16608
16763
|
without<T>(matchAgainst: T[], source: T[]): T[];
|
|
@@ -16677,7 +16832,7 @@ test('ramda test', () => {
|
|
|
16677
16832
|
|
|
16678
16833
|
<details>
|
|
16679
16834
|
|
|
16680
|
-
<summary><strong>
|
|
16835
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16681
16836
|
|
|
16682
16837
|
```typescript
|
|
16683
16838
|
import {without} from 'rambda'
|
|
@@ -16716,7 +16871,7 @@ Logical XOR
|
|
|
16716
16871
|
|
|
16717
16872
|
<details>
|
|
16718
16873
|
|
|
16719
|
-
<summary>All
|
|
16874
|
+
<summary>All TypeScript definitions</summary>
|
|
16720
16875
|
|
|
16721
16876
|
```typescript
|
|
16722
16877
|
xor(x: boolean, y: boolean): boolean;
|
|
@@ -16795,7 +16950,7 @@ test('when one argument is truthy and the other is falsy, it should return true'
|
|
|
16795
16950
|
|
|
16796
16951
|
<details>
|
|
16797
16952
|
|
|
16798
|
-
<summary><strong>
|
|
16953
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16799
16954
|
|
|
16800
16955
|
```typescript
|
|
16801
16956
|
import {xor} from 'rambda'
|
|
@@ -16829,7 +16984,7 @@ The returned list will be truncated to match the length of the shortest supplied
|
|
|
16829
16984
|
|
|
16830
16985
|
<details>
|
|
16831
16986
|
|
|
16832
|
-
<summary>All
|
|
16987
|
+
<summary>All TypeScript definitions</summary>
|
|
16833
16988
|
|
|
16834
16989
|
```typescript
|
|
16835
16990
|
zip<K, V>(x: K[], y: V[]): KeyValuePair<K, V>[];
|
|
@@ -16905,7 +17060,7 @@ test('should truncate result to length of shorted input list', () => {
|
|
|
16905
17060
|
|
|
16906
17061
|
<details>
|
|
16907
17062
|
|
|
16908
|
-
<summary><strong>
|
|
17063
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
16909
17064
|
|
|
16910
17065
|
```typescript
|
|
16911
17066
|
import {zip} from 'rambda'
|
|
@@ -16938,7 +17093,7 @@ It will return a new object with keys of `keys` array and values of `values` arr
|
|
|
16938
17093
|
|
|
16939
17094
|
<details>
|
|
16940
17095
|
|
|
16941
|
-
<summary>All
|
|
17096
|
+
<summary>All TypeScript definitions</summary>
|
|
16942
17097
|
|
|
16943
17098
|
```typescript
|
|
16944
17099
|
zipObj<T, K extends string>(keys: K[], values: T[]): { [P in K]: T };
|
|
@@ -17017,7 +17172,7 @@ test('ignore extra keys', () => {
|
|
|
17017
17172
|
|
|
17018
17173
|
<details>
|
|
17019
17174
|
|
|
17020
|
-
<summary><strong>
|
|
17175
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
17021
17176
|
|
|
17022
17177
|
```typescript
|
|
17023
17178
|
import {zipObj} from 'rambda'
|
|
@@ -17052,7 +17207,7 @@ zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: T[], list2: U[]): TRe
|
|
|
17052
17207
|
|
|
17053
17208
|
<details>
|
|
17054
17209
|
|
|
17055
|
-
<summary>All
|
|
17210
|
+
<summary>All TypeScript definitions</summary>
|
|
17056
17211
|
|
|
17057
17212
|
```typescript
|
|
17058
17213
|
zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: T[], list2: U[]): TResult[];
|
|
@@ -17112,7 +17267,7 @@ test('when second list is longer', () => {
|
|
|
17112
17267
|
|
|
17113
17268
|
<details>
|
|
17114
17269
|
|
|
17115
|
-
<summary><strong>
|
|
17270
|
+
<summary><strong>TypeScript</strong> test</summary>
|
|
17116
17271
|
|
|
17117
17272
|
```typescript
|
|
17118
17273
|
import {zipWith} from 'rambda'
|
|
@@ -17152,9 +17307,31 @@ describe('R.zipWith', () => {
|
|
|
17152
17307
|
|
|
17153
17308
|
## ❯ CHANGELOG
|
|
17154
17309
|
|
|
17310
|
+
8.3.0
|
|
17311
|
+
|
|
17312
|
+
Add the following methods:
|
|
17313
|
+
|
|
17314
|
+
- binary
|
|
17315
|
+
- call
|
|
17316
|
+
- collectBy
|
|
17317
|
+
- comparator
|
|
17318
|
+
- composeWith
|
|
17319
|
+
|
|
17320
|
+
8.2.0
|
|
17321
|
+
|
|
17322
|
+
Add the following methods:
|
|
17323
|
+
|
|
17324
|
+
- addIndex
|
|
17325
|
+
- addIndexRight
|
|
17326
|
+
- ap
|
|
17327
|
+
- aperture
|
|
17328
|
+
- applyTo
|
|
17329
|
+
- ascend
|
|
17330
|
+
- descend
|
|
17331
|
+
|
|
17155
17332
|
8.1.0
|
|
17156
17333
|
|
|
17157
|
-
- Fix input order of TS definitions for `R.propEq` method - [Issue #688](https://github.com/selfrefactor/rambda/issues/688)
|
|
17334
|
+
- 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
17335
|
|
|
17159
17336
|
- Add `R.differenceWith` method - [Issue #91](https://github.com/selfrefactor/rambdax/issues/91)
|
|
17160
17337
|
|
|
@@ -17172,7 +17349,7 @@ describe('R.zipWith', () => {
|
|
|
17172
17349
|
|
|
17173
17350
|
- `R.nop` is removed - it will be moved to `Rambdax` as `R.noop`
|
|
17174
17351
|
|
|
17175
|
-
- `R.includes` is no longer using string literal in
|
|
17352
|
+
- `R.includes` is no longer using string literal in TypeScript definitions
|
|
17176
17353
|
|
|
17177
17354
|
> Reason for breaking change - synchronize with Ramda `0.29.0` release:
|
|
17178
17355
|
|
|
@@ -17202,7 +17379,7 @@ describe('R.zipWith', () => {
|
|
|
17202
17379
|
|
|
17203
17380
|
- Add `R.modify`
|
|
17204
17381
|
|
|
17205
|
-
- Allow multiple inputs in
|
|
17382
|
+
- Allow multiple inputs in TypeScript versions of `R.anyPass` and `R.allPass` - [Issue #642](https://github.com/selfrefactor/rambda/issues/604)
|
|
17206
17383
|
|
|
17207
17384
|
- Using wrong clone of object in `R.mergeDeepRight` - [Issue #650](https://github.com/selfrefactor/rambda/issues/650)
|
|
17208
17385
|
|
|
@@ -17212,7 +17389,7 @@ describe('R.zipWith', () => {
|
|
|
17212
17389
|
|
|
17213
17390
|
7.2.1
|
|
17214
17391
|
|
|
17215
|
-
- Remove bad typings of `R.propIs` which caused the library to cannot be build with
|
|
17392
|
+
- Remove bad typings of `R.propIs` which caused the library to cannot be build with TypeScript.
|
|
17216
17393
|
|
|
17217
17394
|
- Drop support for `Wallaby` as per [https://github.com/wallabyjs/public/issues/3037](https://github.com/wallabyjs/public/issues/3037)
|
|
17218
17395
|
|
|
@@ -17246,7 +17423,7 @@ describe('R.zipWith', () => {
|
|
|
17246
17423
|
|
|
17247
17424
|
- Replace `Async` with `Promise` as return type of `R.type`.
|
|
17248
17425
|
|
|
17249
|
-
- Add new types as
|
|
17426
|
+
- Add new types as TypeScript output for `R.type` - "Map", "WeakMap", "Generator", "GeneratorFunction", "BigInt", "ArrayBuffer"
|
|
17250
17427
|
|
|
17251
17428
|
- Add `R.juxt` method
|
|
17252
17429
|
|
|
@@ -17274,7 +17451,7 @@ Rambda doesn't work with `pnpm` due to wrong export configuration - [Issue #619]
|
|
|
17274
17451
|
|
|
17275
17452
|
7.0.0
|
|
17276
17453
|
|
|
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
|
|
17454
|
+
- 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
17455
|
|
|
17279
17456
|
Related commit in `@types/ramda` - https://github.com/DefinitelyTyped/DefinitelyTyped/commit/286eff4f76d41eb8f091e7437eabd8a60d97fc1f#diff-4f74803fa83a81e47cb17a7d8a4e46a7e451f4d9e5ce2f1bd7a70a72d91f4bc1
|
|
17280
17457
|
|
|
@@ -17357,7 +17534,7 @@ Fixing `R.uniq` was done by improving `R.indexOf` which has performance implicat
|
|
|
17357
17534
|
|
|
17358
17535
|
6.8.3
|
|
17359
17536
|
|
|
17360
|
-
- Fix
|
|
17537
|
+
- Fix TypeScript build process with `rambda/immutable` - [Issue #572](https://github.com/selfrefactor/rambda/issues/572)
|
|
17361
17538
|
|
|
17362
17539
|
- Add `R.objOf` method
|
|
17363
17540
|
|
|
@@ -17377,7 +17554,7 @@ Fixing `R.uniq` was done by improving `R.indexOf` which has performance implicat
|
|
|
17377
17554
|
|
|
17378
17555
|
6.7.0
|
|
17379
17556
|
|
|
17380
|
-
- Remove `ts-toolbelt` types from
|
|
17557
|
+
- Remove `ts-toolbelt` types from TypeScript definitions. Most affected are the following methods, which lose one of its curried definitions:
|
|
17381
17558
|
|
|
17382
17559
|
1. R.maxBy
|
|
17383
17560
|
2. R.minBy
|
|
@@ -17501,7 +17678,7 @@ Fix wrong versions in changelog
|
|
|
17501
17678
|
</td>
|
|
17502
17679
|
<td width="20%" align="center">
|
|
17503
17680
|
<h4>Useful Javascript libraries</h4>
|
|
17504
|
-
<a href="https://github.com/selfrefactor/useful-javascript-libraries">Large collection of JavaScript,
|
|
17681
|
+
<a href="https://github.com/selfrefactor/useful-javascript-libraries">Large collection of JavaScript,TypeScript and Angular related repos links</a>
|
|
17505
17682
|
</td>
|
|
17506
17683
|
<td width="20%" align="center">
|
|
17507
17684
|
<h4>Run-fn</h4>
|