typescript(option): fix: fixed fold returning void
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
1fda9e8242
commit
5c3225273c
|
@ -49,7 +49,7 @@ export const fold = <T, U>(
|
||||||
initial: U,
|
initial: U,
|
||||||
option: Option<T>
|
option: Option<T>
|
||||||
) => {
|
) => {
|
||||||
match(option, v => folder(initial, v), always(initial))
|
return match(option, v => folder(initial, v), always(initial))
|
||||||
}
|
}
|
||||||
|
|
||||||
export const foldback = <T, U>(
|
export const foldback = <T, U>(
|
||||||
|
@ -92,7 +92,7 @@ export const withDefault = <T>(_default: T, option: Option<T>) => {
|
||||||
|
|
||||||
const checkIfOption = <T>(x): x is Option<T> => x[isOption]
|
const checkIfOption = <T>(x): x is Option<T> => x[isOption]
|
||||||
|
|
||||||
export const flat = <T>(option: Option<T>) => {
|
export const flat = <T, U>(option: Option<T>): Option<U> => {
|
||||||
return match(
|
return match(
|
||||||
option,
|
option,
|
||||||
inner => {
|
inner => {
|
||||||
|
|
Loading…
Reference in a new issue