@ukpc-lib/react 0.3.39 → 0.3.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10714,23 +10714,24 @@ function tw(e, t) {
10714
10714
  ).length;
10715
10715
  }
10716
10716
  function Kf(e, t) {
10717
+ var l;
10717
10718
  const n = new URL(t);
10718
- let r = e.filter((l) => l.path && l.path.includes("http")).map((l) => ({
10719
- item: l,
10720
- itemUrl: new URL(l.path),
10721
- matchingParamsCount: tw(t, l.path)
10722
- })).sort((l, u) => {
10723
- const f = new URL(l.itemUrl).searchParams, c = new URL(u.itemUrl).searchParams;
10724
- return Array.from(f).length - Array.from(c).length;
10725
- }).filter(({ itemUrl: l }) => n.origin === l.origin);
10726
- const i = r.filter(({ itemUrl: l }) => n.pathname === l.pathname), o = r.filter(({ itemUrl: l }) => n.pathname.includes(l.pathname));
10727
- r = i.length > 0 ? i : o, r = r.sort((l, u) => u.matchingParamsCount - l.matchingParamsCount);
10728
- let s = r.length > 0 ? r[0].item : null;
10719
+ let r = e.filter((u) => u.path && u.path.includes("http")).map((u) => ({
10720
+ item: u,
10721
+ itemUrl: new URL(u.path),
10722
+ matchingParamsCount: tw(t, u.path)
10723
+ })).sort((u, f) => {
10724
+ const c = new URL(u.itemUrl).searchParams, d = new URL(f.itemUrl).searchParams;
10725
+ return Array.from(c).length - Array.from(d).length;
10726
+ }).filter(({ itemUrl: u }) => n.origin === u.origin);
10727
+ const i = r.filter(({ itemUrl: u }) => n.pathname === u.pathname), o = r.filter(({ itemUrl: u }) => n.pathname.includes(u.pathname));
10728
+ r = i.length > 0 ? i : o, r = r.sort((u, f) => f.matchingParamsCount - u.matchingParamsCount);
10729
+ let s = r.length > 0 ? (l = r.find((u) => u.item.parentKey)) == null ? void 0 : l.item : null;
10729
10730
  console.log("matchingItems:", r);
10730
10731
  let a = [];
10731
10732
  for (; s; )
10732
- a = [s, ...a], s = e.find((l) => l.id === (s == null ? void 0 : s.parentKey)) || null;
10733
- return a;
10733
+ a = [s, ...a], s = e.find((u) => u.id === (s == null ? void 0 : s.parentKey)) || null;
10734
+ return console.log("parents:", a), a;
10734
10735
  }
10735
10736
  function Yf(e, t) {
10736
10737
  return e.map((n) => (n.path && (n.path = t(n.path)), n.children && n.children.length > 0 && (n.children = Yf(n.children, t)), n));