From c0c50ce48e804a3065ddcf2fd2d76a189c233085 Mon Sep 17 00:00:00 2001 From: Mathieu Acthernoene Date: Wed, 6 Dec 2023 11:16:10 +0100 Subject: [PATCH] Add const modifiers on patterns constructors --- src/AsyncData.ts | 2 +- src/OptionResult.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AsyncData.ts b/src/AsyncData.ts index 93da0c8..abe93a4 100644 --- a/src/AsyncData.ts +++ b/src/AsyncData.ts @@ -342,7 +342,7 @@ const Loading = (): AsyncData => LOADING as Loading; const NotAsked = (): AsyncData => NOT_ASKED as NotAsked; const asyncDataPattern = { - Done: (value: A) => ({ tag: "Done", value }) as const, + Done: (value: A) => ({ tag: "Done", value }) as const, NotAsked: { tag: "NotAsked" } as const, Loading: { tag: "Loading" } as const, }; diff --git a/src/OptionResult.ts b/src/OptionResult.ts index b23b130..fdae057 100644 --- a/src/OptionResult.ts +++ b/src/OptionResult.ts @@ -156,7 +156,7 @@ const NONE = (() => { const None = (): Option => NONE as None; const optionPattern = { - Some: (value: A) => ({ tag: "Some", value }) as const, + Some: (value: A) => ({ tag: "Some", value }) as const, None: { tag: "None" } as const, }; @@ -465,8 +465,8 @@ const Error = (value: E): Result => { }; const resultPattern = { - Ok: (value: A) => ({ tag: "Ok", value }) as const, - Error: (value: E) => ({ tag: "Error", value }) as const, + Ok: (value: A) => ({ tag: "Ok", value }) as const, + Error: (value: E) => ({ tag: "Error", value }) as const, }; export const Result = {