feat: store and utils

This commit is contained in:
xingyu4j
2025-05-09 14:38:35 +08:00
parent 372099f35e
commit 83f8bec5db
11 changed files with 1210 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
// 参数校验,对标 Hutool 的 Validator 工具类
/** 手机号正则表达式(中国) */
const MOBILE_REGEX = /(?:0|86|\+86)?1[3-9]\d{9}/;
/**
* 验证是否为手机号码(中国)
*
* @param value 值
* @returns 是否为手机号码(中国)
*/
export function isMobile(value?: null | string): boolean {
if (!value) {
return false;
}
return MOBILE_REGEX.test(value);
}