To create a password with at least one uppercase letter in TypeScript, you can use a regular expression to check if the password contains at least one uppercase character. Here's an example function that generates a random password with at least one uppercase letter:
index.ts739 chars14 lines
This function loops until the password string contains at least one uppercase letter. It generates a random length between 8 and 17 characters, and then generates random characters between ASCII 33 and 126 (inclusive) to fill the password string. Once the password string contains at least one uppercase letter, the function returns the password.
gistlibby LogSnag