UNPKG

@pit-front-end/components

Version:

湖南创智艾泰克科技有限公司

75 lines (74 loc) 1.25 kB
function t(n, e) { return Object.prototype.toString.call(n) === `[object ${e}]`; } function i(n) { return t(n, "Function"); } function u(n) { return typeof n < "u"; } function o(n) { return !u(n); } function r(n) { return n !== null && t(n, "Object"); } function f(n) { return t(n, "Date"); } function s(n) { return t(n, "Number"); } function d(n) { return t(n, "AsyncFunction"); } function y(n) { return t(n, "Promise") && r(n) && i(n.then) && i(n.catch); } function l(n) { return t(n, "String"); } function A(n) { return t(n, "Boolean"); } function b(n) { return n && Array.isArray(n); } function m() { return typeof window < "u"; } function p(n) { return typeof window < "u" && t(n, "Window"); } function w(n) { return r(n) && !!n.tagName; } function c(n) { return n === null; } function F(n) { return o(n) || c(n); } function D(n) { return /^#?(?:[0-9A-F]{3}|[0-9A-F]{6})$/i.test(n); } export { t as is, b as isArray, d as isAsyncFunction, A as isBoolean, m as isClient, f as isDate, u as isDef, w as isElement, i as isFunction, D as isHexColor, c as isNull, F as isNullOrUnDef, s as isNumber, r as isObject, y as isPromise, l as isString, o as isUnDef, p as isWindow };