@ljw_world/check-data
v2.1.2
Published
功能强大的数据检测工具
Downloads
14
Maintainers
Readme
功能强大的数据检测工具
示例
import {
isObject,
isArray,
isFunction,
isString,
isNumber,
isDate,
isRegExp,
isSymbol,
isMap,
isSet,
isNaN,
isNull,
isUndefined,
isEmptyObject,
isEmptyArray,
isEmptyString
} from '@ljw_world/check-data'
检查是否是object
isObject({a: 1}) => true
检查是否是array
isArray([1]) => true
检查是否是function
isFunction(fn) => true
检查是否是string
isString('a') => true
检查是否是number
isNumber(1) => true
检查是否是date日期对象
isDate(new Date()) => true
检查是否是regexp
isRegExp(/\d/) => true
检查是否是Symbol
isSymbol(Symbol('a')) => true
检查是否是Map对象
isMap(new Map()) => true
检查是否是Set对象
isSet(new Set()) => true
检查是否是NaN
isNaN(NaN) => true
检查是否是null
isNull(null) => true
检查是否是undefined
isUndefined(undefined) => true
检查是否是空object
isEmptyObject({}) => true
检查是否是空array
isEmptyArray([]) => true
检查是否是空string
isEmptyString('') => true