business logic, customer communication.

This commit is contained in:
2023-04-06 17:35:09 +08:00
parent 7c5a9214a1
commit 6157f994a9
23 changed files with 717 additions and 156 deletions

View File

@ -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
}