We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4464782 commit 1a4bad7Copy full SHA for 1a4bad7
src/Maybe.ts
@@ -18,13 +18,13 @@ export class Maybe<T> implements Omit<Monad<T>, 'of'> {
18
return new Maybe<never>(null)
19
}
20
21
- static of<T>(value: T | null): Maybe<T> {
+ static of<T>(value: T | null | undefined): Maybe<T> {
22
return value == null ? Maybe.Nothing : Maybe.Just<T>(value)
23
24
25
private constructor(private v: T | null) {}
26
27
- map<U>(f: (x: NonNullable<T>) => U): Maybe<U> {
+ map<U>(f: (x: NonNullable<T>) => U | null | undefined): Maybe<U> {
28
return this.v == null ? Maybe.Nothing : Maybe.of<U>(f(this.v!))
29
30
0 commit comments