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 | 1158c85071e7a8132b42df9481141c107eeee657 (patch) | |
tree | b9ae4f45fe8a23ebc7bc705af97f0377b73f8063 /Timeline/ClientApp/src/app/utilities/language-untilities.ts | |
parent | 1c9edc5914869a3bbde20742c483182636ee4d43 (diff) | |
download | timeline-1158c85071e7a8132b42df9481141c107eeee657.tar.gz timeline-1158c85071e7a8132b42df9481141c107eeee657.tar.bz2 timeline-1158c85071e7a8132b42df9481141c107eeee657.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; } |