Skip to content

Commit

Permalink
Fix matchExact
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-dldc committed Oct 22, 2019
1 parent 389f2c9 commit 92a452b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Chemin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,10 @@ function matchPattern<Params>(pattern: Chemin<Params>, pathname: string | Array<
return matchPart(pattern, pathParts);
}

function matchExactPattern<Params>(
pattern: Chemin<Params>,
pathname: string | Array<string>
): CheminMatchResult<Params> {
function matchExactPattern<Params>(pattern: Chemin<Params>, pathname: string | Array<string>): false | Params {
const match = matchPattern(pattern, pathname);
if (match && match.rest.length === 0) {
return match;
return match.params;
}
return false;
}
Expand Down

0 comments on commit 92a452b

Please sign in to comment.