kempo-server 1.7.2 → 1.7.3
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/package.json +1 -1
- package/src/router.js +11 -8
package/package.json
CHANGED
package/src/router.js
CHANGED
|
@@ -192,15 +192,18 @@ export default async (flags, log) => {
|
|
|
192
192
|
// Helper function to resolve wildcard file paths
|
|
193
193
|
const resolveWildcardPath = (filePath, matches) => {
|
|
194
194
|
let resolvedPath = filePath;
|
|
195
|
+
let matchIndex = 1; // Start from matches[1] (first capture group)
|
|
195
196
|
|
|
196
|
-
// Replace wildcards
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
197
|
+
// Replace ** wildcards first
|
|
198
|
+
while (resolvedPath.includes('**') && matchIndex < matches.length) {
|
|
199
|
+
resolvedPath = resolvedPath.replace('**', matches[matchIndex]);
|
|
200
|
+
matchIndex++;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Replace any remaining * wildcards
|
|
204
|
+
while (resolvedPath.includes('*') && matchIndex < matches.length) {
|
|
205
|
+
resolvedPath = resolvedPath.replace('*', matches[matchIndex]);
|
|
206
|
+
matchIndex++;
|
|
204
207
|
}
|
|
205
208
|
|
|
206
209
|
// If the path is already absolute, return it as-is
|