a RegEx for phone numbers (issue #45)
This commit is contained in:
parent
cac9fa594d
commit
e00c8ea975
2
dist/mailgo.dark.min.js
vendored
2
dist/mailgo.dark.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/mailgo.dark.min.js.map
vendored
2
dist/mailgo.dark.min.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/mailgo.min.js
vendored
2
dist/mailgo.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/mailgo.min.js.map
vendored
2
dist/mailgo.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -992,8 +992,7 @@ var validateEmails = function validateEmails(arr) {
|
|||||||
|
|
||||||
|
|
||||||
var validateTel = function validateTel(tel) {
|
var validateTel = function validateTel(tel) {
|
||||||
// TODO: find a good regex for telephone numbers
|
return /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/.test(tel);
|
||||||
return true;
|
|
||||||
}; // copy of a string
|
}; // copy of a string
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -891,10 +891,8 @@ const validateEmail = (email: string): boolean =>
|
|||||||
const validateEmails = (arr: string[]): boolean => arr.every(validateEmail);
|
const validateEmails = (arr: string[]): boolean => arr.every(validateEmail);
|
||||||
|
|
||||||
// validate a single tel with regex
|
// validate a single tel with regex
|
||||||
const validateTel = (tel: string): boolean => {
|
const validateTel = (tel: string): boolean =>
|
||||||
// TODO: find a good regex for telephone numbers
|
/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/.test(tel);
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
// copy of a string
|
// copy of a string
|
||||||
const copyToClipboard = (str: string): boolean => {
|
const copyToClipboard = (str: string): boolean => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user