Skip to content

Commit

Permalink
fix: solve all Codecov issues
Browse files Browse the repository at this point in the history
  • Loading branch information
silvioprog committed Jul 9, 2020
1 parent 48a81f1 commit 3394479
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utilities/phone/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,9 @@ export function isValidLandlinePhone(phone: string): boolean {
}

export function isValid(phone: string): boolean {
return isValidMobilePhone(phone) || isValidLandlinePhone(phone);
const { isValidDigits, digits } = parsePhoneDigits(phone);

if (!isValidDigits) return false;

return isValidLength(digits) && isValidFirstNumber(digits) && isValidDDD(digits);
}

0 comments on commit 3394479

Please sign in to comment.