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 matched values for :name* patterns. (#126) #56

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

wanderview
Copy link
Contributor

This fixes the problem where:

const p = new URLPattern({ pathname: ':name*' });
const r = p.exec('foobar');
console.log(r.pathname.groups.name);

Would log 'r' instead of 'foobar'.

This is an upstream bug in path-to-regexp:

pillarjs/path-to-regexp#260

This commit essentially applies the proposed fix in:

pillarjs/path-to-regexp#261

And adds the WPT tests from:

https://chromium-review.googlesource.com/c/chromium/src/+/3123654

This fixes the problem where:

  const p = new URLPattern({ pathname: ':name*' });
  const r = p.exec('foobar');
  console.log(r.pathname.groups.name);

Would log 'r' instead of 'foobar'.

This is an upstream bug in path-to-regexp:

  pillarjs/path-to-regexp#260

This commit essentially applies the proposed fix in:

  pillarjs/path-to-regexp#261

And adds the WPT tests from:

  https://chromium-review.googlesource.com/c/chromium/src/+/3123654
@wanderview
Copy link
Contributor Author

@kenchris PTAL

Copy link
Owner

@kenchris kenchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Always love the test coverage

@kenchris kenchris merged commit 7a5adfe into kenchris:main Jan 11, 2022
@wanderview wanderview deleted the dev-named-wildcard branch January 11, 2022 22:03
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.

2 participants