intelliwaketssveltekitv25 0.1.121 → 0.1.122
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/PathAnalyzer.js +19 -10
- package/package.json +1 -1
package/dist/PathAnalyzer.js
CHANGED
|
@@ -101,6 +101,15 @@ export class PathAnalyzer {
|
|
|
101
101
|
return BuildPath('/', ...this.predecessorComponents);
|
|
102
102
|
let components = [...this.preComponents, ...this.activePageComponents];
|
|
103
103
|
if (!components[components.length - 1]?.toLowerCase().startsWith('tab')) {
|
|
104
|
+
const indexOfBase = components.findIndex(comp => comp === this.base);
|
|
105
|
+
const indexOfTab = components.findIndex(comp => comp.toLowerCase().startsWith('tab'));
|
|
106
|
+
if (indexOfBase > 0 && indexOfBase >= indexOfTab) {
|
|
107
|
+
const indexOfTilde = components.findIndex(comp => comp === '~');
|
|
108
|
+
if (indexOfTilde > 0) {
|
|
109
|
+
return BuildPath('/', ...components.slice(0, indexOfBase + 1), ...components.slice(indexOfTilde, components.length - 1));
|
|
110
|
+
}
|
|
111
|
+
return BuildPath('/', ...components.slice(0, indexOfBase + 1));
|
|
112
|
+
}
|
|
104
113
|
return BuildPath('/', ...components.slice(0, components.length - 1));
|
|
105
114
|
}
|
|
106
115
|
while (components[components.length - 1]?.toLowerCase().startsWith('tab')) {
|
|
@@ -163,16 +172,16 @@ export class PathAnalyzer {
|
|
|
163
172
|
if (closeIfOpen) {
|
|
164
173
|
// const pathNoDigits = path.replace(/[0-9]/g, '')
|
|
165
174
|
if (this.isOpen(path)) {
|
|
166
|
-
if (path.includes('/')) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
else {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
175
|
+
// if (path.includes('/')) {
|
|
176
|
+
// console.log(this.base, this.basePath, path)
|
|
177
|
+
// return BuildPath(this.basePath, path.substring(0, path.indexOf('/')))
|
|
178
|
+
// } else {
|
|
179
|
+
// if (path === pathNoDigits) {
|
|
180
|
+
return this.basePath;
|
|
181
|
+
// } else {
|
|
182
|
+
// return BuildPath(this.basePath, pathNoDigits)
|
|
183
|
+
// }
|
|
184
|
+
// }
|
|
176
185
|
// } else if (pathNoDigits !== path && path === this.activePageSlug) {
|
|
177
186
|
// return BuildPath(this.basePath, pathNoDigits)
|
|
178
187
|
// } else if (pathNoDigits === path && path === (this.activePageSlug ?? '').replace(/[0-9]/g, '') && pathNoDigits !== this.activePage) {
|