dora-ui
Version:
A React.js Mobile UI Library
20 lines • 636 B
JavaScript
var toString = Object.prototype.toString;
export var isUndefined = function isUndefined(x) {
return typeof x === 'undefined';
};
export var isType = function isType(type) {
return function (x) {
return toString.call(x).slice(8, -1) === type;
};
};
export var isArray = isType('Array');
export var isString = isType('String');
export var isFunction = isType('Function');
export var isNull = isType('Null');
export var isPlainObject = isType('Object');
export var isNumber = function isNumber(x) {
return typeof x === 'number' && !isNaN(x);
};
export var isBoolean = function isBoolean(x) {
return typeof x === 'boolean';
};