aboutsummaryrefslogtreecommitdiff
path: root/src/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.ts')
-rw-r--r--src/util.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.ts b/src/util.ts
index 6d713a8..1ed019c 100644
--- a/src/util.ts
+++ b/src/util.ts
@@ -151,3 +151,7 @@ export function capitalizeWords(str: string){
str = str.replace(/(\w)'S/, '$1\'s'); // Avoid cases like "traveler's tree" -> "Traveler'S Tree"
return str;
}
+// Used to async-await for until after a timeout
+export async function timeout(ms: number){
+ return new Promise(resolve => setTimeout(resolve, ms))
+}