From 4014f0cb99164ea5110ec162ce7636d8efb8329f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Meireles?= Date: Tue, 18 Jan 2022 13:31:43 +0000 Subject: [PATCH] src/helpers.ts: idiomatic tweaks to Outcome scheme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: António Meireles --- src/helpers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers.ts b/src/helpers.ts index 517bfc1..e99c87e 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -52,9 +52,9 @@ interface Failure { error: Error } type Outcome = Success | Failure -const Abnormal = (result: unknown): result is Failure => - (result as { error?: Error }).error !== undefined -const Ok = (result: unknown): result is Success => !Abnormal(result) +const Abnormal = (outcome: unknown): outcome is Failure => + (outcome as { error?: Error }).error !== undefined +const Ok = (outcome: unknown): outcome is Success => !Abnormal(outcome) export { Abnormal,