rambda 9.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +23 -11
- package/immutable.d.ts +13 -10
- package/index.d.ts +13 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|

|
|
10
10
|
[](https://packagephobia.com/result?p=rambda)
|
|
11
11
|
[](https://nest.land/package/rambda)
|
|
12
|
+
[](https://github.com/selfrefactor/rambda/pulls)
|
|
12
13
|
|
|
13
14
|
## ❯ Example use
|
|
14
15
|
|
|
@@ -9802,7 +9803,8 @@ Logical OR
|
|
|
9802
9803
|
|
|
9803
9804
|
```typescript
|
|
9804
9805
|
|
|
9805
|
-
over<
|
|
9806
|
+
over<S, A>(lens: Lens<S, A>): {
|
|
9807
|
+
(fn: (a: A) => A): (value: S) => S
|
|
9806
9808
|
```
|
|
9807
9809
|
|
|
9808
9810
|
It returns a copied **Object** or **Array** with modified value received by applying function `fn` to `lens` focus.
|
|
@@ -9814,12 +9816,12 @@ It returns a copied **Object** or **Array** with modified value received by appl
|
|
|
9814
9816
|
<summary>All TypeScript definitions</summary>
|
|
9815
9817
|
|
|
9816
9818
|
```typescript
|
|
9817
|
-
over<
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
over(lens: Lens
|
|
9822
|
-
over(lens: Lens
|
|
9819
|
+
over<S, A>(lens: Lens<S, A>): {
|
|
9820
|
+
(fn: (a: A) => A): (value: S) => S;
|
|
9821
|
+
(fn: (a: A) => A, value: S): S;
|
|
9822
|
+
};
|
|
9823
|
+
over<S, A>(lens: Lens<S, A>, fn: (a: A) => A): (value: S) => S;
|
|
9824
|
+
over<S, A>(lens: Lens<S, A>, fn: (a: A) => A, value: S): S;
|
|
9823
9825
|
```
|
|
9824
9826
|
|
|
9825
9827
|
</details>
|
|
@@ -13005,7 +13007,10 @@ describe('R.reverse', () => {
|
|
|
13005
13007
|
|
|
13006
13008
|
```typescript
|
|
13007
13009
|
|
|
13008
|
-
set<
|
|
13010
|
+
set<S, A>(lens: Lens<S, A>): {
|
|
13011
|
+
(a: A): (obj: S) => S
|
|
13012
|
+
(a: A, obj: S): S
|
|
13013
|
+
}
|
|
13009
13014
|
```
|
|
13010
13015
|
|
|
13011
13016
|
It returns a copied **Object** or **Array** with modified `lens` focus set to `replacer` value.
|
|
@@ -13017,9 +13022,12 @@ It returns a copied **Object** or **Array** with modified `lens` focus set to `r
|
|
|
13017
13022
|
<summary>All TypeScript definitions</summary>
|
|
13018
13023
|
|
|
13019
13024
|
```typescript
|
|
13020
|
-
set<
|
|
13021
|
-
|
|
13022
|
-
|
|
13025
|
+
set<S, A>(lens: Lens<S, A>): {
|
|
13026
|
+
(a: A): (obj: S) => S
|
|
13027
|
+
(a: A, obj: S): S
|
|
13028
|
+
};
|
|
13029
|
+
set<S, A>(lens: Lens<S, A>, a: A): (obj: S) => S;
|
|
13030
|
+
set<S, A>(lens: Lens<S, A>, a: A, obj: S): S;
|
|
13023
13031
|
```
|
|
13024
13032
|
|
|
13025
13033
|
</details>
|
|
@@ -17242,6 +17250,10 @@ describe('R.zipWith', () => {
|
|
|
17242
17250
|
|
|
17243
17251
|
## ❯ CHANGELOG
|
|
17244
17252
|
|
|
17253
|
+
9.0.1
|
|
17254
|
+
|
|
17255
|
+
- Fix bad TS typings, due to missing declaration - [Issue #716](https://github.com/selfrefactor/rambda/issues/716)
|
|
17256
|
+
|
|
17245
17257
|
9.0.0
|
|
17246
17258
|
|
|
17247
17259
|
Breaking change in TS definitions of `lenses` as now they are synced to `Ramda` types.
|
package/immutable.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface KeyValuePair<K, V> extends Array<K | V> {
|
|
|
42
42
|
readonly 0: K;
|
|
43
43
|
readonly 1: V;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
export type Functor<A> = { readonly map: <B>(fn: (a: A) => B) => Functor<B>; readonly [key: string]: any };
|
|
46
46
|
export type Lens<S, A> = (functorFactory: (a: A) => Functor<A>) => (s: S) => Functor<S>;
|
|
47
47
|
|
|
48
48
|
type Arity1Fn = (x: any) => any;
|
|
@@ -1158,12 +1158,12 @@ export function or<T>(a: T): <U>(b: U) => T | U;
|
|
|
1158
1158
|
/**
|
|
1159
1159
|
* It returns a copied **Object** or **Array** with modified value received by applying function `fn` to `lens` focus.
|
|
1160
1160
|
*/
|
|
1161
|
-
export function over<
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
export function over(lens: Lens
|
|
1166
|
-
export function over(lens: Lens
|
|
1161
|
+
export function over<S, A>(lens: Lens<S, A>): {
|
|
1162
|
+
(fn: (a: A) => A): (value: S) => S;
|
|
1163
|
+
(fn: (a: A) => A, value: S): S;
|
|
1164
|
+
};
|
|
1165
|
+
export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A): (value: S) => S;
|
|
1166
|
+
export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A, value: S): S;
|
|
1167
1167
|
|
|
1168
1168
|
/**
|
|
1169
1169
|
* It is very similar to `R.curry`, but you can pass initial arguments when you create the curried function.
|
|
@@ -1502,9 +1502,12 @@ export function reverse(input: string): string;
|
|
|
1502
1502
|
/**
|
|
1503
1503
|
* It returns a copied **Object** or **Array** with modified `lens` focus set to `replacer` value.
|
|
1504
1504
|
*/
|
|
1505
|
-
export function set<
|
|
1506
|
-
|
|
1507
|
-
|
|
1505
|
+
export function set<S, A>(lens: Lens<S, A>): {
|
|
1506
|
+
(a: A): (obj: S) => S
|
|
1507
|
+
(a: A, obj: S): S
|
|
1508
|
+
};
|
|
1509
|
+
export function set<S, A>(lens: Lens<S, A>, a: A): (obj: S) => S;
|
|
1510
|
+
export function set<S, A>(lens: Lens<S, A>, a: A, obj: S): S;
|
|
1508
1511
|
|
|
1509
1512
|
export function slice(from: number, to: number, input: string): string;
|
|
1510
1513
|
export function slice<T>(from: number, to: number, input: readonly T[]): readonly T[];
|
package/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface KeyValuePair<K, V> extends Array<K | V> {
|
|
|
42
42
|
0: K;
|
|
43
43
|
1: V;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
export type Functor<A> = { map: <B>(fn: (a: A) => B) => Functor<B>; [key: string]: any };
|
|
46
46
|
export type Lens<S, A> = (functorFactory: (a: A) => Functor<A>) => (s: S) => Functor<S>;
|
|
47
47
|
|
|
48
48
|
type Arity1Fn = (x: any) => any;
|
|
@@ -1158,12 +1158,12 @@ export function or<T>(a: T): <U>(b: U) => T | U;
|
|
|
1158
1158
|
/**
|
|
1159
1159
|
* It returns a copied **Object** or **Array** with modified value received by applying function `fn` to `lens` focus.
|
|
1160
1160
|
*/
|
|
1161
|
-
export function over<
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
export function over(lens: Lens
|
|
1166
|
-
export function over(lens: Lens
|
|
1161
|
+
export function over<S, A>(lens: Lens<S, A>): {
|
|
1162
|
+
(fn: (a: A) => A): (value: S) => S;
|
|
1163
|
+
(fn: (a: A) => A, value: S): S;
|
|
1164
|
+
};
|
|
1165
|
+
export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A): (value: S) => S;
|
|
1166
|
+
export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A, value: S): S;
|
|
1167
1167
|
|
|
1168
1168
|
/**
|
|
1169
1169
|
* It is very similar to `R.curry`, but you can pass initial arguments when you create the curried function.
|
|
@@ -1502,9 +1502,12 @@ export function reverse(input: string): string;
|
|
|
1502
1502
|
/**
|
|
1503
1503
|
* It returns a copied **Object** or **Array** with modified `lens` focus set to `replacer` value.
|
|
1504
1504
|
*/
|
|
1505
|
-
export function set<
|
|
1506
|
-
|
|
1507
|
-
|
|
1505
|
+
export function set<S, A>(lens: Lens<S, A>): {
|
|
1506
|
+
(a: A): (obj: S) => S
|
|
1507
|
+
(a: A, obj: S): S
|
|
1508
|
+
};
|
|
1509
|
+
export function set<S, A>(lens: Lens<S, A>, a: A): (obj: S) => S;
|
|
1510
|
+
export function set<S, A>(lens: Lens<S, A>, a: A, obj: S): S;
|
|
1508
1511
|
|
|
1509
1512
|
export function slice(from: number, to: number, input: string): string;
|
|
1510
1513
|
export function slice<T>(from: number, to: number, input: T[]): T[];
|
package/package.json
CHANGED