We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48a81f1 commit 3394479Copy full SHA for 3394479
1 file changed
src/utilities/phone/index.ts
@@ -65,5 +65,9 @@ export function isValidLandlinePhone(phone: string): boolean {
65
}
66
67
export function isValid(phone: string): boolean {
68
- return isValidMobilePhone(phone) || isValidLandlinePhone(phone);
+ const { isValidDigits, digits } = parsePhoneDigits(phone);
69
+
70
+ if (!isValidDigits) return false;
71
72
+ return isValidLength(digits) && isValidFirstNumber(digits) && isValidDDD(digits);
73
0 commit comments