From f31a0c8c6ba8d8deb98f2a8608a2e838f478489d Mon Sep 17 00:00:00 2001 From: Jorge Oliveira Date: Thu, 12 Sep 2024 15:17:12 +0100 Subject: [PATCH] Update index.js https://github.com/expressjs/express/issues/5955 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1150335..52edd3e 100644 --- a/index.js +++ b/index.js @@ -65,7 +65,7 @@ function pathToRegexp(path, keys, options) { return new RegExp(path.join('|'), flags); } - path = path.replace( + path = String(path).replace( /\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g, function (match, slash, format, key, capture, star, optional, offset) { pos = offset + match.length;