From 5c3225273c2b85c0129b6c6adc8ceabf7b5f3920 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 20:23:59 +0200 Subject: [PATCH] typescript(option): fix: fixed fold returning void Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 => {