two-stroke 8.0.15 → 8.0.17

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