Skip to content

Commit

Permalink
Merge pull request #39 from qubyte/dependabot/npm_and_yarn/path-to-re…
Browse files Browse the repository at this point in the history
…gexp-7.0.0

Bump path-to-regexp from 6.2.2 to 7.0.0
  • Loading branch information
qubyte authored Sep 16, 2024
2 parents a3ee61d + 0c4311e commit ee03726
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18, 20]
node_version: [18, 20, 22]
steps:
- name: checkout
uses: actions/checkout@main
Expand Down
47 changes: 32 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions packages/router/lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ function makeRoute(path, preNormalizedHandlers, options) {
const handlers = normalizeHandlers(preNormalizedHandlers);
const allowedMethods = Object.keys(handlers);
const allow = allowedMethods.sort().join(', ');
const keys = [];
const regex = pathToRegexp(path, keys, options);
const { keys, regexp } = pathToRegexp(path, options);

function notAllowed(_req, res) {
res.writeHead(405, { allow }).end();
}

return function match(req) {
const { pathname } = new URL(req.url, 'http://none');
const paramList = regex.exec(pathname);
const paramList = regexp.exec(pathname);

if (paramList) {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@toisu/middleware-runner": "^4.0.0",
"path-to-regexp": "^6.2.1"
"path-to-regexp": "^8.1.0"
},
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit ee03726

Please sign in to comment.