Skip to content

Commit a39c661

Browse files
committed
Don't try do decode undefined
decodeURIComponent(undefined) is "undefined"
1 parent fcd8e3e commit a39c661

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/matchPattern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const getMatcher = (pattern, exactly) => {
2323

2424
const parseParams = (pattern, match, keys) =>
2525
match.slice(1).reduce((params, value, index) => {
26-
params[keys[index].name] = decodeURIComponent(value)
26+
params[keys[index].name] = value === undefined ? undefined : decodeURIComponent(value)
2727
return params
2828
}, {})
2929

0 commit comments

Comments
 (0)