1.0.5 • Published 5 years ago

javascript-type-validate v1.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

javascript-type-validate

一个javascript数据类型校验小工具

Description

执行时方法时, 根据当前的数据, 返回一个布尔值

Example

import validator from "javascript-type-validate"

console.log("validate string: ")
console.log(validator.isString("1"))
// => true
console.log(validator.isString())
// => false
console.log(validator.isString(1))
// => false
console.log(validator.isString(true))
// => false

Methods

// 是否为string类型
- isString
// 是否为number类型
- isNumber
// 是否为undefined类型
- isUndefined
// 是否为null类型
- isNull
// 是否为object类型
- isObject
// 是否为array类型
- isArray
// 是否为function类型
- isFunction
// 是否为error类型
- isError
// 是否为symbol类型
- isSymbol
// 是否为NaN类型
- isNaN
// 是否为boolean类型
- isBoolean
// 是否为date类型
- isDate