From 9e98463001394404077f2777686b13fdf23d3429 Mon Sep 17 00:00:00 2001 From: Pablo Palacios Date: Thu, 26 Aug 2021 23:52:43 +0200 Subject: [PATCH] package.json: update path-to-regexp to latest version (#113) --- lib/router.js | 5 +++-- package-lock.json | 23 ++++++++++++++++------- package.json | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/lib/router.js b/lib/router.js index 874d933..029a467 100644 --- a/lib/router.js +++ b/lib/router.js @@ -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; } @@ -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) { diff --git a/package-lock.json b/package-lock.json index 51bbeb2..8884ea7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2037,7 +2037,8 @@ "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true }, "isexe": { "version": "2.0.0", @@ -2508,6 +2509,17 @@ "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", "path-to-regexp": "^1.7.0" + }, + "dependencies": { + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "requires": { + "isarray": "0.0.1" + } + } } }, "nopt": { @@ -2624,12 +2636,9 @@ "dev": true }, "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "requires": { - "isarray": "0.0.1" - } + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.0.tgz", + "integrity": "sha512-f66KywYG6+43afgE/8j/GoiNyygk/bnoCbps++3ErRKsIYkGGupyv07R2Ok5m9i67Iqc+T2g1eAUGUPzWhYTyg==" }, "pathval": { "version": "1.1.1", diff --git a/package.json b/package.json index a9b9ca4..419ec69 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ } ], "dependencies": { - "path-to-regexp": "^1.1.1" + "path-to-regexp": "^6.2.0" }, "devDependencies": { "babel-eslint": "^10.0.2",