-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Randomly noticed this:
export const e164: RegExp = /^\+(?:[0-9]){6,14}[0-9]$/;
This allows phone numbers like +000000000 that are invalid.
Maybe /^\+[1-9]\d{6,14}$/ would be better.
I don't think that the reference is explicit on this, but there are no country codes starting with 0.
Happy to send a PR if you think this could be improved in Zod v4.
coderabbitai
Metadata
Metadata
Assignees
Labels
No labels