niudaren_utils_checks
v1.0.1
Published
## instal pnpm install
Downloads
2
Readme
检查的一个工具
instal
pnpm install
usage
import { funName} from './niudaren_utils_checks'
API
.checkBrowser
判断是浏览器内核
Params
returns
string
Example
const core = checkBrowser()
.checkBrowser
判断是浏览器内核
Params
returns
string
Example
const core = checkBrowser()
.checkIosAndroidIpad
判断是终端类型,值有ios,android,iPad
Params
returns
string
Example
const deviceType = checkIosAndroidIpad()
.checkTelphone
判断是否是国内手机号,只要是13,14,15,16,17,18,19开头即可
Params
data
stringreturns
bool
Example
const phone = '13235900000'
const flag = checkTelphone(phone)
.checkUrl
判断是否是正确的网址
Params
url
stringreturns
bool
Example
const url = 'https://www.npmjs.com/'
const flag = checkUrl(url)
.checkEmail
判断是否是邮箱地址
Params
data
stringreturns
bool
Example
const email = '[email protected]'
const flag = checkEmail(email)
.checkNum
判断是否是数字
Params
data
numberreturns
bool
Example
const num = 123456
const flag = checkNum(num)
.checkLetter
判断是否是字母
Params
data
stringreturns
bool
Example
const data = 123456
const flag = checkLetter(data)