Skip to content

Commit dbdd09b

Browse files
joonhochotimdorr
authored andcommitted
Update getRouteParams.js (#3544)
1 parent b9a334e commit dbdd09b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

modules/getRouteParams.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,11 @@ function getRouteParams(route, params) {
1010
if (!route.path)
1111
return routeParams
1212

13-
const paramNames = getParamNames(route.path)
14-
15-
for (const p in params) {
16-
if (
17-
Object.prototype.hasOwnProperty.call(params, p) &&
18-
paramNames.indexOf(p) !== -1
19-
) {
13+
getParamNames(route.path).forEach(p => {
14+
if (Object.prototype.hasOwnProperty.call(params, p)) {
2015
routeParams[p] = params[p]
2116
}
22-
}
17+
})
2318

2419
return routeParams
2520
}

0 commit comments

Comments
 (0)