business logic, customer communication.

This commit is contained in:
tsanie committed 2023-04-06 17:35:09 +08:00
1 parent 7c5a9214a1
commit 6157f994a9
23 files changed
+717 -156

No files matched your search

+11 -1
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
}