From 5df644ea57351559594048c2898edf1b6d5a66a5 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Thu, 26 Aug 2021 23:18:17 +0200 Subject: [PATCH] Add test for ":name*" parameter matching --- src/index.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/index.spec.ts b/src/index.spec.ts index b0a65b5..f0c695f 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -2592,6 +2592,24 @@ const TESTS: Test[] = [ [{ foo: "123" }, "/whatever/123"], [{ foo: "#" }, null] ] + ], + /** + * https://github.com/pillarjs/path-to-regexp/issues/260 + */ + [ + ":name*", + undefined, + [ + { + name: "name", + prefix: "", + suffix: "", + modifier: "*", + pattern: "[^\\/#\\?]+?" + } + ], + [["foobar", ["foobar", "foobar"]]], + [[{ name: "foobar" }, "foobar"]] ] ];