Skip to content

Commit

Permalink
package.json: update path-to-regexp to latest version (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablopalacios authored Aug 26, 2021
1 parent a6d9ee4 commit 9e98463
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
5 changes: 3 additions & 2 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function Route(name, config, options) {
}
}
this.keys = [];
this.regexp = pathToRegexp(this.config.path, this.keys);
this.regexp = pathToRegexp.pathToRegexp(this.config.path, this.keys);
this._queryLib = options.queryLib || queryString;
}

Expand Down Expand Up @@ -200,7 +200,8 @@ Route.prototype._makePath = function (routePath, params, query) {
var strQuery;
if (typeof routePath === 'string') {
compiler =
cachedCompilers[routePath] || pathToRegexp.compile(routePath);
cachedCompilers[routePath] ||
pathToRegexp.compile(routePath, { encode: encodeURIComponent });
cachedCompilers[routePath] = compiler;
url = compiler(params);
if (query) {
Expand Down
23 changes: 16 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
],
"dependencies": {
"path-to-regexp": "^1.1.1"
"path-to-regexp": "^6.2.0"
},
"devDependencies": {
"babel-eslint": "^10.0.2",
Expand Down

0 comments on commit 9e98463

Please sign in to comment.