Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Wildcard splat/rest param matches should return undefined instead of empty strings #45

Merged
merged 2 commits into from
Oct 20, 2024

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Oct 19, 2024

Whilst preactjs/wmr@d503514 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.

@rschristian rschristian changed the title fix: Wildcard splat matches fix: Wildcard splat matches should return undefined instead of empty strings Oct 20, 2024
@rschristian rschristian changed the title fix: Wildcard splat matches should return undefined instead of empty strings fix: Wildcard splat/rest param matches should return undefined instead of empty strings Oct 20, 2024
@rschristian rschristian merged commit 98b95d0 into main Oct 20, 2024
1 check passed
@rschristian rschristian deleted the fix/wildcard-splat branch October 20, 2024 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant