From 780e5d7b1a5971e4f133ca32abf44dd4255a6825 Mon Sep 17 00:00:00 2001 From: Ikwue Inalegwu Date: Mon, 16 Sep 2024 02:14:28 +0100 Subject: [PATCH] tests passing --- src/test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test.ts b/src/test.ts index 6f373fb..cd69641 100644 --- a/src/test.ts +++ b/src/test.ts @@ -8,4 +8,10 @@ const unsafeDivide = (a: number, b: number) => { const safeDivide = makeSafeFunction(unsafeDivide); safeDivide(1, 2).match(console.log, console.error); -safeDivide(1, 0).match(console.log, console.error); +const zeroDiv = safeDivide(1, 0); + +if (zeroDiv.isOk()) { + console.log(zeroDiv.value); +} else { + console.log(`IT HAPPENED::${zeroDiv.error}`); +}