UNPKG

@aplus-frontend/ui

Version:

42 lines (41 loc) 1.51 kB
import { isArray as i, isString as u, isRegExp as f } from "lodash-unified"; const o = (r) => { const e = r?.subTree?.children; if (typeof e == "string") return; const n = Array.isArray(e) ? e : null; if (n) return n.filter((t) => !["string", "number", "boolean"].includes(typeof t)).filter((t) => t && typeof t == "object" && "type" in t ? t.type != /* @__PURE__ */ Symbol.for("v-cmt") : !1); }, l = (r) => { if (r) { if (r.length > 1) throw Error("ApKeepAlive 组件只能有一个字节点"); if (r[0]) return r[0]; } }, p = (r) => { if (r && !(typeof r == "string" || typeof r == "number" || typeof r == "boolean" || Array.isArray(r))) return r; }, a = (r) => { if (r && !(typeof r == "string" || typeof r == "number" || typeof r == "boolean" || Array.isArray(r) || !r.type)) return r; }, b = (r, e) => { const n = typeof r.type == "object" && "name" in r.type && r.type.name || ""; let t = n; return r.key && r.key !== e && (t = r.key), { VnodeName: n, vnodeSubPath: t }; }, g = (r) => typeof r == "object" && "name" in r && r.name || ""; function y(r, e) { return i(r) ? r.some((n) => y(n, e)) : u(r) ? r.split(",").includes(e) : f(r) ? (r.lastIndex = 0, r.test(e)) : !1; } function m(r) { return [void 0, null].includes(r); } export { b as getAliveKey, g as getComponentName, l as getFirstVNodeChirldren, o as getVNodeChirldren, a as getVNodeObjByVNodeArrayChildren, p as getVNodeObjByVNodeChild, m as isNoValue, y as matches };