Skip to content

Commit

Permalink
Do not ignore '0' from route params to build path
Browse files Browse the repository at this point in the history
Fixes #72, Fixes #46
  • Loading branch information
thdk committed Mar 2, 2019
1 parent e1c34e2 commit 55c1d36
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ export class Route {
// eslint-disable-next-line
([fullMatch, paramKey, paramKeyWithoutColon]) => {
const value = jsParams[paramKeyWithoutColon];
newPath = value
? newPath.replace(paramKey, value)
: newPath.replace(`/${paramKey}`, '');
newPath =
value !== undefined
? newPath.replace(paramKey, value)
: newPath.replace(`/${paramKey}`, '');
}
);

Expand Down

0 comments on commit 55c1d36

Please sign in to comment.