nitropack-nightly 2.12.3-20250717-181931.7a83e130 → 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.
@@ -1,4 +1,4 @@
1
- const version = "2.12.3-20250717-181931.7a83e130";
1
+ const version = "2.12.4-20250722-074250.3fcc0190";
2
2
 
3
3
  const compatibilityChanges = [
4
4
  {
@@ -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 === "**" ? "?(?<_>.*)" : `?(?<${segment.slice(3)}>.+)`;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.12.3-20250717-181931.7a83e130",
3
+ "version": "2.12.4-20250722-074250.3fcc0190",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",