fnts 1.5.2 → 1.5.3

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.
@@ -7,9 +7,9 @@ import type { Map } from '../../types/map';
7
7
  * Binds the value of the `monad` to new monad created
8
8
  * by the `transition` function.
9
9
  */
10
- export default function bind<Value, NextValue>(transition: Map<Value, Maybe<NextValue>>): (monad: Maybe<Value>) => Maybe<NextValue>;
10
+ export default function bind<Value, NextValue>(transition: Map<Value, Maybe<NextValue>>): (monad: Maybe<Value>) => Maybe<NonNullable<NextValue>>;
11
11
  /**
12
12
  * Binds the value of the `monad` to new monad created
13
13
  * by the `transition` function.
14
14
  */
15
- export default function bind<Value, NextValue>(monad: Maybe<Value>, transition: Map<Value, Maybe<NextValue>>): Maybe<NextValue>;
15
+ export default function bind<Value, NextValue>(monad: Maybe<Value>, transition: Map<Value, Maybe<NextValue>>): Maybe<NonNullable<NextValue>>;
@@ -7,9 +7,9 @@ import type { Map } from '../../types/map';
7
7
  * Maps the value of the provided `monad` through the `transition` function
8
8
  * and returns a new `Maybe` of the mapped value.
9
9
  */
10
- export default function fmap<Value, NextValue = Value>(transition: Map<Value, NextValue>): (monad: Maybe<Value>) => Maybe<NextValue>;
10
+ export default function fmap<Value, NextValue = Value>(transition: Map<Value, NextValue>): (monad: Maybe<Value>) => Maybe<NonNullable<NextValue>>;
11
11
  /**
12
12
  * Maps the value of the provided `monad` through the `transition` function
13
13
  * and returns a new `Maybe` of the mapped value.
14
14
  */
15
- export default function fmap<Value, NextValue = Value>(monad: Maybe<Value>, transition: Map<Value, NextValue>): Maybe<NextValue>;
15
+ export default function fmap<Value, NextValue = Value>(monad: Maybe<Value>, transition: Map<Value, NextValue>): Maybe<NonNullable<NextValue>>;
@@ -8,14 +8,14 @@ import type { Map } from '../../types/map';
8
8
  /**
9
9
  * A type to unwrap the provided `Monad` into the new value type.
10
10
  */
11
- export declare type FoldMap<Monad extends Maybe<any>, NextValue> = Monad extends Just<any> ? NextValue : Monad extends Nothing ? null : never;
11
+ export declare type FoldMap<Monad extends Maybe<any>, NextValue> = Monad extends Just<any> ? NonNullable<NextValue> : Monad extends Nothing ? null : never;
12
12
  /**
13
13
  * Maps the value of the provided `monad` through the `transition` function
14
14
  * and returns the mapped value or `null`.
15
15
  */
16
- export default function foldMap<Value, NextValue = Value>(transition: Map<Value, NextValue>): (monad: Maybe<Value>) => NextValue | null;
16
+ export default function foldMap<Value, NextValue = Value>(transition: Map<Value, NextValue>): (monad: Maybe<Value>) => FoldMap<Maybe<Value>, NextValue>;
17
17
  /**
18
18
  * Maps the value of the provided `monad` through the `transition` function
19
19
  * and returns the mapped value or `null`.
20
20
  */
21
- export default function foldMap<Value, NextValue = Value>(monad: Maybe<Value>, transition: Map<Value, NextValue>): NextValue | null;
21
+ export default function foldMap<Value, NextValue = Value>(monad: Maybe<Value>, transition: Map<Value, NextValue>): FoldMap<Maybe<Value>, NextValue>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fnts",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "license": "MIT",
5
5
  "author": "Dmytro Vasylkivskyi",
6
6
  "description": "TypeScript / JavaScript FP utilities",