diff options
author | crupest <crupest@outlook.com> | 2019-03-16 20:57:31 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-16 20:57:31 +0800 |
commit | cfc1a24bcb782721780eb79cc45260db16ffad64 (patch) | |
tree | ed3322ad10a6c1acbf08bba73e930b5702fb44e6 /Timeline/ClientApp/src/app/utilities/language-untilities.ts | |
parent | 393ca55a960abc7d2343a8a36a093d253eddf134 (diff) | |
download | timeline-cfc1a24bcb782721780eb79cc45260db16ffad64.tar.gz timeline-cfc1a24bcb782721780eb79cc45260db16ffad64.tar.bz2 timeline-cfc1a24bcb782721780eb79cc45260db16ffad64.zip |
Add remember me.
Diffstat (limited to 'Timeline/ClientApp/src/app/utilities/language-untilities.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/utilities/language-untilities.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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<T>(value: T | undefined): T | null { } export function throwIfNullOrUndefined<T>(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; } |