1
Fork 0

Add a capitalize utility function.

This commit is contained in:
Bauke 2023-12-22 14:36:29 +01:00
parent 26568b33de
commit 6f256e44fc
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 7 additions and 0 deletions

View File

@ -25,3 +25,10 @@ export async function hashSha256(input: string): Promise<string> {
.map((byte) => byte.toString(16).padStart(2, "0"))
.join("");
}
/**
* Capitalize the input string by making the first character in it uppercase.
*/
export function capitalize(input: string): string {
return input[0].toUpperCase() + input.slice(1);
}