diff options
author | crupest <crupest@outlook.com> | 2019-04-13 13:03:18 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-13 13:03:18 +0800 |
commit | fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07 (patch) | |
tree | 39cf181a18a3dc443dbab5669a04d0a23cdefd00 /Timeline/ClientApp/src/app/utilities/language-untilities.ts | |
parent | 8c5e7069d2651fb6fae641dfe482d7a0910b3fd1 (diff) | |
download | timeline-fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07.tar.gz timeline-fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07.tar.bz2 timeline-fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07.zip |
Init separate.
Diffstat (limited to 'Timeline/ClientApp/src/app/utilities/language-untilities.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/utilities/language-untilities.ts | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/Timeline/ClientApp/src/app/utilities/language-untilities.ts b/Timeline/ClientApp/src/app/utilities/language-untilities.ts deleted file mode 100644 index 94434665..00000000 --- a/Timeline/ClientApp/src/app/utilities/language-untilities.ts +++ /dev/null @@ -1,18 +0,0 @@ -export function nullIfUndefined<T>(value: T | undefined): T | null { - return value === undefined ? null : value; -} - -export function throwIfNullOrUndefined<T>(value: T | null | undefined, - message: string | (() => string) = 'Value mustn\'t be null or undefined'): T | never { - if (value === null || value === undefined) { - throw new Error(typeof message === 'string' ? message : message()); - } else { - return value; - } -} - -export function repeat(time: number, action: (index?: number) => void) { - for (let i = 0; i < time; i++) { - action(i); - } -} |