fix(cli): 🚨 Use RegExp literal instead of .match()

This commit is contained in:
Jesse Wierzbinski 2025-02-26 00:12:31 +01:00
parent f98d7ec560
commit ce64afe283
No known key found for this signature in database

View file

@ -35,7 +35,7 @@ export const createUserCommand = defineCommand(
const { admin, email, password } = context.flags; const { admin, email, password } = context.flags;
const { username } = context.parameters; const { username } = context.parameters;
if (!username.match(/^[a-z0-9_-]+$/)) { if (!/^[a-z0-9_-]+$/.test(username)) {
throw new Error("Username must be alphanumeric and lowercase."); throw new Error("Username must be alphanumeric and lowercase.");
} }