baaz-custom-components 3.2.9 → 3.2.10
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 +8 -1
- package/dist/index.mjs +8 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -756,10 +756,17 @@ function treeContainsPath({
|
|
|
756
756
|
if (baseOrigin && currentOrigin && baseOrigin !== currentOrigin) {
|
|
757
757
|
return false;
|
|
758
758
|
}
|
|
759
|
+
function normalizeDynamic(path) {
|
|
760
|
+
if (path.endsWith("/-")) {
|
|
761
|
+
return path.slice(0, -2);
|
|
762
|
+
}
|
|
763
|
+
return path;
|
|
764
|
+
}
|
|
759
765
|
for (const node of data) {
|
|
760
766
|
if (typeof node.routes === "string") {
|
|
761
767
|
const full = buildFullHref(base, node.routes);
|
|
762
|
-
|
|
768
|
+
let hrefPath = extractPathname(full);
|
|
769
|
+
hrefPath = normalizeDynamic(hrefPath);
|
|
763
770
|
if (pathname === hrefPath || pathname.startsWith(hrefPath + "/")) {
|
|
764
771
|
return true;
|
|
765
772
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -722,10 +722,17 @@ function treeContainsPath({
|
|
|
722
722
|
if (baseOrigin && currentOrigin && baseOrigin !== currentOrigin) {
|
|
723
723
|
return false;
|
|
724
724
|
}
|
|
725
|
+
function normalizeDynamic(path) {
|
|
726
|
+
if (path.endsWith("/-")) {
|
|
727
|
+
return path.slice(0, -2);
|
|
728
|
+
}
|
|
729
|
+
return path;
|
|
730
|
+
}
|
|
725
731
|
for (const node of data) {
|
|
726
732
|
if (typeof node.routes === "string") {
|
|
727
733
|
const full = buildFullHref(base, node.routes);
|
|
728
|
-
|
|
734
|
+
let hrefPath = extractPathname(full);
|
|
735
|
+
hrefPath = normalizeDynamic(hrefPath);
|
|
729
736
|
if (pathname === hrefPath || pathname.startsWith(hrefPath + "/")) {
|
|
730
737
|
return true;
|
|
731
738
|
}
|