Update libphonenumber-js
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
isPossiblePhoneNumber,
|
||||
ParseError,
|
||||
parsePhoneNumber,
|
||||
parsePhoneNumberWithError,
|
||||
validatePhoneNumberLength,
|
||||
} from "libphonenumber-js"
|
||||
import { z } from "zod"
|
||||
@@ -24,7 +24,7 @@ export function phoneValidator(
|
||||
.superRefine((value, ctx) => {
|
||||
if (value) {
|
||||
try {
|
||||
const phoneNumber = parsePhoneNumber(value)
|
||||
const phoneNumber = parsePhoneNumberWithError(value)
|
||||
if (phoneNumber) {
|
||||
if (isPossiblePhoneNumber(value, phoneNumber.country)) {
|
||||
return validatePhoneNumberLength(value, phoneNumber.country)
|
||||
|
||||
Reference in New Issue
Block a user