@nex-ui/utils
Version:
Utility functions for React components.
14 lines (11 loc) • 585 B
JavaScript
;
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';
exports.isFunction = isFunction;
exports.isNumber = isNumber;
exports.isPlainObject = isPlainObject;
exports.isString = isString;
exports.isUndefined = isUndefined;