refactor: 提取正则和验证到 @vben/utils

This commit is contained in:
xingyu4j
2025-09-03 16:46:22 +08:00
parent 44eebda749
commit deb412662e
10 changed files with 46 additions and 51 deletions

View File

@@ -0,0 +1,16 @@
import { MOBILE_REGEX } from './regex';
/**
* 验证是否为手机号码(中国)
*
* @param value 值
* @returns 是否为手机号码(中国)
*/
function isMobile(value?: null | string): boolean {
if (!value) {
return false;
}
return MOBILE_REGEX.test(value);
}
export { isMobile };