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 CHANGED
@@ -1,3 +1,7 @@
1
+ 9.0.1
2
+
3
+ - Fix bad TS typings, due to missing declaration - [Issue #716](https://github.com/selfrefactor/rambda/issues/716)
4
+
1
5
  9.0.0
2
6
 
3
7
  Breaking change in TS definitions of `lenses` as now they are synced to `Ramda` types.
package/README.md CHANGED
@@ -9,6 +9,7 @@
9
9
  ![Library size](https://img.shields.io/bundlephobia/minzip/rambda)
10
10
  [![install size](https://packagephobia.com/badge?p=rambda)](https://packagephobia.com/result?p=rambda)
11
11
  [![nest badge](https://nest.land/badge.svg)](https://nest.land/package/rambda)
12
+ [![PR's Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](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<T>(lens: Lens, fn: Arity1Fn, value: T): T
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<T>(lens: Lens, fn: Arity1Fn, value: T): T;
9818
- over<T>(lens: Lens, fn: Arity1Fn, value: T[]): T[];
9819
- over(lens: Lens, fn: Arity1Fn): <T>(value: T) => T;
9820
- over(lens: Lens, fn: Arity1Fn): <T>(value: T[]) => T[];
9821
- over(lens: Lens): <T>(fn: Arity1Fn, value: T) => T;
9822
- over(lens: Lens): <T>(fn: Arity1Fn, value: T[]) => T[];
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<T, U>(lens: Lens, replacer: U, obj: T): T
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<T, U>(lens: Lens, replacer: U, obj: T): T;
13021
- set<U>(lens: Lens, replacer: U): <T>(obj: T) => T;
13022
- set(lens: Lens): <T, U>(replacer: U, obj: T) => T;
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<T>(lens: Lens, fn: Arity1Fn, value: T): T;
1162
- export function over<T>(lens: Lens, fn: Arity1Fn, value: readonly T[]): readonly T[];
1163
- export function over(lens: Lens, fn: Arity1Fn): <T>(value: T) => T;
1164
- export function over(lens: Lens, fn: Arity1Fn): <T>(value: readonly T[]) => readonly T[];
1165
- export function over(lens: Lens): <T>(fn: Arity1Fn, value: T) => T;
1166
- export function over(lens: Lens): <T>(fn: Arity1Fn, value: readonly T[]) => readonly T[];
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<T, U>(lens: Lens, replacer: U, obj: T): T;
1506
- export function set<U>(lens: Lens, replacer: U): <T>(obj: T) => T;
1507
- export function set(lens: Lens): <T, U>(replacer: U, obj: T) => T;
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<T>(lens: Lens, fn: Arity1Fn, value: T): T;
1162
- export function over<T>(lens: Lens, fn: Arity1Fn, value: T[]): T[];
1163
- export function over(lens: Lens, fn: Arity1Fn): <T>(value: T) => T;
1164
- export function over(lens: Lens, fn: Arity1Fn): <T>(value: T[]) => T[];
1165
- export function over(lens: Lens): <T>(fn: Arity1Fn, value: T) => T;
1166
- export function over(lens: Lens): <T>(fn: Arity1Fn, value: T[]) => T[];
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<T, U>(lens: Lens, replacer: U, obj: T): T;
1506
- export function set<U>(lens: Lens, replacer: U): <T>(obj: T) => T;
1507
- export function set(lens: Lens): <T, U>(replacer: U, obj: T) => T;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rambda",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "scripts": {
5
5
  "benchmark": "cd ../rambda-scripts && RAMBDA_RUN_ALL=ON RAMBDA_RUN_INDEXES=ON yarn benchmark",
6
6
  "benchmark:all": "yarn build:step && cd ../rambda-scripts && yarn benchmark:all",