UNPKG

@anoki/fse-ui

Version:

FSE UI components library

77 lines (76 loc) 2.43 kB
import { __exports as i } from "./index.es775.js"; import { __require as m } from "./index.es679.js"; import { __require as E } from "./index.es723.js"; var g; function h() { if (g) return i; g = 1, Object.defineProperty(i, "__esModule", { value: !0 }), i.testElement = p, i.getElements = _, i.getElementById = v, i.getElementsByTagName = d, i.getElementsByClassName = l, i.getElementsByTagType = T; var u = /* @__PURE__ */ m(), f = /* @__PURE__ */ E(), o = { tag_name: function(e) { return typeof e == "function" ? function(t) { return (0, u.isTag)(t) && e(t.name); } : e === "*" ? u.isTag : function(t) { return (0, u.isTag)(t) && t.name === e; }; }, tag_type: function(e) { return typeof e == "function" ? function(t) { return e(t.type); } : function(t) { return t.type === e; }; }, tag_contains: function(e) { return typeof e == "function" ? function(t) { return (0, u.isText)(t) && e(t.data); } : function(t) { return (0, u.isText)(t) && t.data === e; }; } }; function a(e, t) { return typeof t == "function" ? function(n) { return (0, u.isTag)(n) && t(n.attribs[e]); } : function(n) { return (0, u.isTag)(n) && n.attribs[e] === t; }; } function y(e, t) { return function(n) { return e(n) || t(n); }; } function c(e) { var t = Object.keys(e).map(function(n) { var r = e[n]; return Object.prototype.hasOwnProperty.call(o, n) ? o[n](r) : a(n, r); }); return t.length === 0 ? null : t.reduce(y); } function p(e, t) { var n = c(e); return n ? n(t) : !0; } function _(e, t, n, r) { r === void 0 && (r = 1 / 0); var s = c(e); return s ? (0, f.filter)(s, t, n, r) : []; } function v(e, t, n) { return n === void 0 && (n = !0), Array.isArray(t) || (t = [t]), (0, f.findOne)(a("id", e), t, n); } function d(e, t, n, r) { return n === void 0 && (n = !0), r === void 0 && (r = 1 / 0), (0, f.filter)(o.tag_name(e), t, n, r); } function l(e, t, n, r) { return n === void 0 && (n = !0), r === void 0 && (r = 1 / 0), (0, f.filter)(a("class", e), t, n, r); } function T(e, t, n, r) { return n === void 0 && (n = !0), r === void 0 && (r = 1 / 0), (0, f.filter)(o.tag_type(e), t, n, r); } return i; } export { h as __require }; //# sourceMappingURL=index.es724.js.map