zod
zod copied to clipboard
Tighten E.164 regex in regexes.ts to require a non-zero leading digit with 7-15 digits
Summary
Tightened the E.164 regex to /^\+[1-9]\d{6,14}$/ to require a non-zero leading digit while keeping the 7–15 digit constraint.
Added invalid test cases for leading-zero country codes and cleaned up the E.164 test harness logging.
Tests
pnpm test (reported passing) Added the below test cases
"+0000000", // leading zero country code
"+0123456789", // leading zero with more digits
Related PRs:
- #3476