Merge "feat: Make phone number input international & change library related"

This commit is contained in:
Zuul
2021-11-12 04:03:51 +00:00
committed by Gerrit Code Review
14 changed files with 1247 additions and 19 deletions

View File

@@ -15,7 +15,7 @@
import { isString, isNil } from 'lodash';
import { Address4, Address6 } from 'ip-address';
import cidrRegex from 'cidr-regex';
import { phone } from 'phone';
import { isValidPhoneNumber } from 'libphonenumber-js';
const { v4, v6 } = cidrRegex;
@@ -75,7 +75,7 @@ export const regex = {
asciiRegex,
};
export const isPhoneNumber = (value) => phone(value).isValid;
export const isPhoneNumber = (value) => isValidPhoneNumber(value);
export const isEmailNumber = (value) => emailRegex.test(value);