From 1158c85071e7a8132b42df9481141c107eeee657 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 16 Mar 2019 20:57:31 +0800 Subject: Add remember me. --- Timeline/ClientApp/src/app/utilities/language-untilities.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Timeline/ClientApp/src/app/utilities') diff --git a/Timeline/ClientApp/src/app/utilities/language-untilities.ts b/Timeline/ClientApp/src/app/utilities/language-untilities.ts index be9df2dc..7f38f3e4 100644 --- a/Timeline/ClientApp/src/app/utilities/language-untilities.ts +++ b/Timeline/ClientApp/src/app/utilities/language-untilities.ts @@ -3,9 +3,9 @@ export function nullIfUndefined(value: T | undefined): T | null { } export function throwIfNullOrUndefined(value: T | null | undefined, - lazyMessage: () => string = () => 'Value mustn\'t be falsy'): T | never { + message: string | (() => string) = 'Value mustn\'t be null or undefined'): T | never { if (value === null || value === undefined) { - throw new Error(lazyMessage()); + throw new Error(typeof message === 'string' ? message : message()); } else { return value; } -- cgit v1.2.3