UNPKG

@nex-ui/utils

Version:

Utility functions for React components.

8 lines (6 loc) 476 B
const isNumber = (value)=>typeof value === 'number'; const isFunction = (value)=>typeof value === 'function' && !/^class\s/.test(Function.prototype.toString.call(value)); const isPlainObject = (value)=>typeof value === 'object' && Object.prototype.toString.call(value) === '[object Object]'; const isString = (value)=>typeof value === 'string'; const isUndefined = (value)=>typeof value === 'undefined'; export { isFunction, isNumber, isPlainObject, isString, isUndefined };