@nex-ui/utils
Version:
Utility functions for React components.
16 lines (13 loc) • 659 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';
const isArray = (value)=>Array.isArray(value);
exports.isArray = isArray;
exports.isFunction = isFunction;
exports.isNumber = isNumber;
exports.isPlainObject = isPlainObject;
exports.isString = isString;
exports.isUndefined = isUndefined;
;