two-stroke 8.0.14 → 8.0.15

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "two-stroke",
3
- "version": "8.0.14",
3
+ "version": "8.0.15",
4
4
  "description": "Simple Cloudflare Worker framework.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/index.ts CHANGED
@@ -374,7 +374,8 @@ export function twoStroke<T>(
374
374
  method: "PUT",
375
375
  path,
376
376
  matcher: new RegExp(
377
- `^${escapeRegex(path).replaceAll(/\/{(?<seg>[^}]*)}/g, String.raw`/(?<$seg>[^\/]*)`)}$`,
377
+ // oxlint-disable-next-line unicorn/prefer-string-raw
378
+ `^${escapeRegex(path).replaceAll(/\/{(?<seg>[^}]*)}/g, "/(?<$seg>[^\\/]*)")}$`,
378
379
  ),
379
380
  input,
380
381
  output,
@@ -396,7 +397,8 @@ export function twoStroke<T>(
396
397
  method: "POST",
397
398
  path,
398
399
  matcher: new RegExp(
399
- `^${escapeRegex(path).replaceAll(/\/{(?<seg>[^}]*)}/g, String.raw`/(?<$seg>[^\/]*)`)}$`,
400
+ // oxlint-disable-next-line unicorn/prefer-string-raw
401
+ `^${escapeRegex(path).replaceAll(/\/{(?<seg>[^}]*)}/g, "/(?<$seg>[^\\/]*)")}$`,
400
402
  ),
401
403
  input,
402
404
  output,
@@ -417,7 +419,8 @@ export function twoStroke<T>(
417
419
  method: "GET",
418
420
  path,
419
421
  matcher: new RegExp(
420
- `^${escapeRegex(path).replaceAll(/\/{(?<seg>[^}]*)}/g, String.raw`/(?<$seg>[^\/]*)`)}$`,
422
+ // oxlint-disable-next-line unicorn/prefer-string-raw
423
+ `^${escapeRegex(path).replaceAll(/\/{(?<seg>[^}]*)}/g, "/(?<$seg>[^\\/]*)")}$`,
421
424
  ),
422
425
  output,
423
426
  handler,
@@ -436,7 +439,8 @@ export function twoStroke<T>(
436
439
  method: "DELETE",
437
440
  path,
438
441
  matcher: new RegExp(
439
- `^${escapeRegex(path).replaceAll(/\/{(?<seg>[^}]*)}/g, String.raw`/(?<$seg>[^\/]*)`)}$`,
442
+ // oxlint-disable-next-line unicorn/prefer-string-raw
443
+ `^${escapeRegex(path).replaceAll(/\/{(?<seg>[^}]*)}/g, "/(?<$seg>[^\\/]*)")}$`,
440
444
  ),
441
445
  output,
442
446
  handler,