mitools
v0.0.17
Published
一些常用的工具类
Downloads
18
Readme
MiTools
一些常用的工具类
安装
# 推荐使用 pnpm
pnpm i mitools
# npm
npm i mitools
已实现工具
enum2options
把一个对象类型转换为一个 选择项类型isIdCardNo
是否身份证openUrl
浏览器打开一个链接sleep
休眠telTo
打电话
userAgent 工具
isAndroid
是否 AndroidisApple
是否苹果isWechatDev
是否微信开发者工具isWxBrowser
是否微信浏览器
url 工具
includePath
是否包含某路径samePath
是否相同路径isUrl
是否 url
oss 工具
fastOssProcessUrl
快速生成一个 oss 处理地址getOssProcessUrl
生成 oss 处理地址
string 字符串工具
getRandomStr
获取随机字符串
reg 常用正则
MOBILE_REG
手机号正则 带国际区号校验EMAIL_REG
邮箱正则ID_CARD_REG
身份证正则REPEAT_TIMES
重复字符SPECIAL_CHARACTER
特殊字符ONLY_LETTER
纯字母ONLY_NUMBER
纯数字CONTAIN_SPACE
空格
rules 字段校验规则
POWER_PASSWORD
强密码