winbox-ui-next
Version:
We Design Vue 2.0: A Vue.js 3 UI Library
39 lines (38 loc) • 1.15 kB
JavaScript
const opt = Object.prototype.toString;
function isArray(obj) {
return opt.call(obj) === "[object Array]";
}
function isNull(obj) {
return opt.call(obj) === "[object Null]";
}
function isBoolean(obj) {
return opt.call(obj) === "[object Boolean]";
}
function isObject(obj) {
return opt.call(obj) === "[object Object]";
}
const isPromise = (obj) => {
return opt.call(obj) === "[object Promise]";
};
function isString(obj) {
return opt.call(obj) === "[object String]";
}
function isNumber(obj) {
return opt.call(obj) === "[object Number]" && obj === obj;
}
function isUndefined(obj) {
return obj === void 0;
}
function isFunction(obj) {
return typeof obj === "function";
}
function isWindow(el) {
return el === window;
}
const isComponentInstance = (value) => {
return (value == null ? void 0 : value.$) !== void 0;
};
function isDayjs(time) {
return isObject(time) && "$y" in time && "$M" in time && "$D" in time && "$d" in time && "$H" in time && "$m" in time && "$s" in time;
}
export { isArray, isBoolean, isComponentInstance, isDayjs, isFunction, isNull, isNumber, isObject, isPromise, isString, isUndefined, isWindow };