This PR therefore corrects that and adds proper tests, but also ensures optional params become undefined, rather than empty strings, to match the behavior of /:x? in the case of the param not being set. I'd call this non-breaking as the previous behavior isn't correct or consistent and any falsy check will still fail all the same.
Whilst https://github.com/preactjs/wmr/commit/d503514743da838f086d5760fbc62144f93fc774 added a test entry for
/:x*
paths, unfortunately it copied the test block for optional params (/:x?
) and only updated the test name -- the actual test cases were duplicates that didn't ensure what they were meant to.This PR therefore corrects that and adds proper tests, but also ensures optional params become
undefined
, rather than empty strings, to match the behavior of/:x?
in the case of the param not being set. I'd call this non-breaking as the previous behavior isn't correct or consistent and any falsy check will still fail all the same.