business logic, customer communication.
This commit is contained in:
@ -31,6 +31,14 @@ function truncate(v) {
|
||||
return (v > 0 ? Math.floor : Math.ceil)(v);
|
||||
}
|
||||
|
||||
function isEmail(text) {
|
||||
return /^\w[-\w.+]*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(text);
|
||||
}
|
||||
|
||||
function isPhone(text) {
|
||||
return /^[1-9]\d{9,}$/.test(text);
|
||||
}
|
||||
|
||||
export {
|
||||
// cookie
|
||||
getCookie,
|
||||
@ -55,5 +63,7 @@ export {
|
||||
isMobile,
|
||||
// functions
|
||||
throttle,
|
||||
truncate
|
||||
truncate,
|
||||
isEmail,
|
||||
isPhone
|
||||
}
|
Reference in New Issue
Block a user