From 1d443d39a5dda4c6993e03aeb1384e8c1e17205b Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Tue, 5 Jul 2022 03:11:01 +1000 Subject: Add images to help information --- src/util.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src/util.ts') diff --git a/src/util.ts b/src/util.ts index 034879e..142e8eb 100644 --- a/src/util.ts +++ b/src/util.ts @@ -135,6 +135,7 @@ export function randWeightedChoice(weights: number[]): number | null { export function capitalizeWords(str: string){ str = str.replace(/\b\w/g, x => x.toUpperCase()); // '\b' matches word boundary, '\w' is like [a-zA-Z0-9_] str = str.replace(/(\w)'S/, '$1\'s'); // Avoid cases like "traveler's tree" -> "Traveler'S Tree" + str = str.replace(/ And\b/, ' and'); // Avoid cases like "frogs and toads" -> "Frogs And Toads" return str; } // Used to async-await for until after a timeout -- cgit v1.2.3