mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(cli): 🚨 Use RegExp literal instead of .match()
This commit is contained in:
parent
f98d7ec560
commit
ce64afe283
|
|
@ -35,7 +35,7 @@ export const createUserCommand = defineCommand(
|
|||
const { admin, email, password } = context.flags;
|
||||
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.");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue