baaz-custom-components 3.2.18 → 3.2.19
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.
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -793,20 +793,20 @@ function getActiveChildGroup(data, base, pathname) {
|
|
|
793
793
|
const full = buildFullHref(base, routes);
|
|
794
794
|
let hrefPath = extractPathname(full);
|
|
795
795
|
if (hrefPath.endsWith("/-")) hrefPath = hrefPath.slice(0, -2);
|
|
796
|
-
if (pathname
|
|
796
|
+
if (pathname.startsWith(hrefPath)) {
|
|
797
797
|
return null;
|
|
798
798
|
}
|
|
799
|
-
} else
|
|
799
|
+
} else {
|
|
800
800
|
const children = routes;
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
if (
|
|
809
|
-
if (children.length >
|
|
801
|
+
const anyChildMatches = children.some((child) => {
|
|
802
|
+
if (typeof child.routes !== "string") return false;
|
|
803
|
+
const full = buildFullHref(base, child.routes);
|
|
804
|
+
let hrefPath = extractPathname(full);
|
|
805
|
+
if (hrefPath.endsWith("/-")) hrefPath = hrefPath.slice(0, -2);
|
|
806
|
+
return pathname.startsWith(hrefPath);
|
|
807
|
+
});
|
|
808
|
+
if (anyChildMatches) {
|
|
809
|
+
if (children.length > 1) {
|
|
810
810
|
return { base, children };
|
|
811
811
|
}
|
|
812
812
|
return null;
|
package/dist/index.mjs
CHANGED
|
@@ -759,20 +759,20 @@ function getActiveChildGroup(data, base, pathname) {
|
|
|
759
759
|
const full = buildFullHref(base, routes);
|
|
760
760
|
let hrefPath = extractPathname(full);
|
|
761
761
|
if (hrefPath.endsWith("/-")) hrefPath = hrefPath.slice(0, -2);
|
|
762
|
-
if (pathname
|
|
762
|
+
if (pathname.startsWith(hrefPath)) {
|
|
763
763
|
return null;
|
|
764
764
|
}
|
|
765
|
-
} else
|
|
765
|
+
} else {
|
|
766
766
|
const children = routes;
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
if (
|
|
775
|
-
if (children.length >
|
|
767
|
+
const anyChildMatches = children.some((child) => {
|
|
768
|
+
if (typeof child.routes !== "string") return false;
|
|
769
|
+
const full = buildFullHref(base, child.routes);
|
|
770
|
+
let hrefPath = extractPathname(full);
|
|
771
|
+
if (hrefPath.endsWith("/-")) hrefPath = hrefPath.slice(0, -2);
|
|
772
|
+
return pathname.startsWith(hrefPath);
|
|
773
|
+
});
|
|
774
|
+
if (anyChildMatches) {
|
|
775
|
+
if (children.length > 1) {
|
|
776
776
|
return { base, children };
|
|
777
777
|
}
|
|
778
778
|
return null;
|