feat: filter routeParams param

This commit is contained in:
DIYgod 2024-06-27 03:25:34 +08:00
parent d09eba6baf
commit 181c7570e8
No known key found for this signature in database
1 changed files with 7 additions and 5 deletions

View File

@ -95,11 +95,13 @@ export const parseRegexpPathParams = (regexpPath: string) => {
const array: PathParams[] = []
for (const item of pathToRegexp(transformedPath).keys) {
array.push({
name: item.name,
optional: item.modifier === "?" || item.modifier === "*",
isCatchAll: item.name === CATCH_ALL_GROUP_KEY || item.modifier === "*",
})
if (item.name !== "routeParams") {
array.push({
name: item.name,
optional: item.modifier === "?" || item.modifier === "*",
isCatchAll: item.name === CATCH_ALL_GROUP_KEY || item.modifier === "*",
})
}
}
const map = array.reduce((acc, { name, optional, isCatchAll }) => {