From ec9efc7edc3133459612e6e799e68a454e8148ba Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 17 Mar 2019 21:57:24 +0800 Subject: Add unit test. --- Timeline/ClientApp/src/app/utilities/language-untilities.ts | 6 ++++++ 1 file changed, 6 insertions(+) (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 7f38f3e4..94434665 100644 --- a/Timeline/ClientApp/src/app/utilities/language-untilities.ts +++ b/Timeline/ClientApp/src/app/utilities/language-untilities.ts @@ -10,3 +10,9 @@ export function throwIfNullOrUndefined(value: T | null | undefined, return value; } } + +export function repeat(time: number, action: (index?: number) => void) { + for (let i = 0; i < time; i++) { + action(i); + } +} -- cgit v1.2.3