From 3c2522cb3223ebaec638da46ade3e02dc65568a3 Mon Sep 17 00:00:00 2001 From: Carlos Santos <65308244+casantosmu@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:51:16 +0100 Subject: [PATCH] fix: * param renamed to wildcard (#775) --- lib/util/format-param-url.js | 4 ++-- test/util.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/util/format-param-url.js b/lib/util/format-param-url.js index 7d8b029a..d5ce7d52 100644 --- a/lib/util/format-param-url.js +++ b/lib/util/format-param-url.js @@ -65,9 +65,9 @@ function formatParamUrl (str) { state = 'regexp' level++ } else if (char === '*') { - // * -> wildcard + // * -> {*} // should be exist once only - path += '{wildcard}' + path += '{*}' } else { path += char } diff --git a/test/util.js b/test/util.js index 345002e5..d0a62fb8 100644 --- a/test/util.js +++ b/test/util.js @@ -10,7 +10,7 @@ const cases = [ ['/example/:userId/:secretToken', '/example/{userId}/{secretToken}'], ['/example/near/:lat-:lng/radius/:r', '/example/near/{lat}-{lng}/radius/{r}'], ['/example/near/:lat_1-:lng_1/radius/:r_1', '/example/near/{lat_1}-{lng_1}/radius/{r_1}'], - ['/example/*', '/example/{wildcard}'], + ['/example/*', '/example/{*}'], ['/example/:file(^\\d+).png', '/example/{file}.png'], ['/example/at/:hour(^\\d{2})h:minute(^\\d{2})m', '/example/at/{hour}h{minute}m'], ['/example/at/(^\\d{2})h(^\\d{2})m', '/example/at/{regexp1}h{regexp2}m'],