diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index bb455ad..b248d65 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -49,7 +49,7 @@ export const fold = ( initial: U, option: Option ) => { - match(option, v => folder(initial, v), always(initial)) + return match(option, v => folder(initial, v), always(initial)) } export const foldback = ( @@ -92,7 +92,7 @@ export const withDefault = (_default: T, option: Option) => { const checkIfOption = (x): x is Option => x[isOption] -export const flat = (option: Option) => { +export const flat = (option: Option): Option => { return match( option, inner => {