Skip to content

Commit

Permalink
fix: * param renamed to wildcard (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
casantosmu authored Dec 28, 2023
1 parent d357b96 commit 3c2522c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/util/format-param-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion test/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 3c2522c

Please sign in to comment.