nitropack-nightly 2.12.3-20250717-181903.086d21d8 → 2.12.4-20250722-074250.3fcc0190
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/meta/index.mjs
CHANGED
|
@@ -282,5 +282,5 @@ async function generateWorkerName(nitro) {
|
|
|
282
282
|
);
|
|
283
283
|
const pkgName = pkgJSON?.name;
|
|
284
284
|
const subpath = relative(nitro.options.workspaceDir, nitro.options.rootDir);
|
|
285
|
-
return `${gitRepo || pkgName}/${subpath}`.replace(/[^a-zA-Z0-9-]/g, "-").replace(/-$/, "");
|
|
285
|
+
return `${gitRepo || pkgName}/${subpath}`.toLowerCase().replace(/[^a-zA-Z0-9-]/g, "-").replace(/-$/, "");
|
|
286
286
|
}
|
|
@@ -270,17 +270,23 @@ function normalizeRouteSrc(route) {
|
|
|
270
270
|
let idCtr = 0;
|
|
271
271
|
return route.split("/").map((segment) => {
|
|
272
272
|
if (segment.startsWith("**")) {
|
|
273
|
-
return segment === "**" ? "
|
|
273
|
+
return segment === "**" ? "(?:.*)" : `?(?<${namedGroup(segment.slice(3))}>.+)`;
|
|
274
274
|
}
|
|
275
275
|
if (segment === "*") {
|
|
276
276
|
return `(?<_${idCtr++}>[^/]*)`;
|
|
277
277
|
}
|
|
278
278
|
if (segment.includes(":")) {
|
|
279
|
-
return segment.replace(/:(\w+)/g, (_, id) => `(?<${id}>[^/]+)`).replace(/\./g, String.raw`\.`);
|
|
279
|
+
return segment.replace(/:(\w+)/g, (_, id) => `(?<${namedGroup(id)}>[^/]+)`).replace(/\./g, String.raw`\.`);
|
|
280
280
|
}
|
|
281
281
|
return segment;
|
|
282
282
|
}).join("/");
|
|
283
283
|
}
|
|
284
|
+
function namedGroup(input = "") {
|
|
285
|
+
if (/\d/.test(input[0])) {
|
|
286
|
+
input = `_${input}`;
|
|
287
|
+
}
|
|
288
|
+
return input.replace(/[^a-zA-Z0-9_]/g, "") || "_";
|
|
289
|
+
}
|
|
284
290
|
function normalizeRouteDest(route) {
|
|
285
291
|
return route.split("/").slice(1).map((segment) => {
|
|
286
292
|
if (segment.startsWith("**")) {
|
package/package.json
CHANGED