Skip to content

Commit 747df8c

Browse files
committed
refactor: replaced transform with toLowerCase for Username and Email Schema more explicit about it's purpose
1 parent ba11040 commit 747df8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/utils/user-validation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const UsernameSchema = z
1111
message: 'Username can only include letters, numbers, and underscores',
1212
})
1313
// users can type the username in any case, but we store it in lowercase
14-
.transform((value) => value.toLowerCase())
14+
.toLowerCase()
1515

1616
export const PasswordSchema = z
1717
.string({ required_error: 'Password is required' })
@@ -33,7 +33,7 @@ export const EmailSchema = z
3333
.min(3, { message: 'Email is too short' })
3434
.max(100, { message: 'Email is too long' })
3535
// users can type the email in any case, but we store it in lowercase
36-
.transform((value) => value.toLowerCase())
36+
.toLowerCase()
3737

3838
export const PasswordAndConfirmPasswordSchema = z
3939
.object({ password: PasswordSchema, confirmPassword: PasswordSchema })

0 commit comments

Comments
 (0)