kenchris / urlpattern-polyfill

URLPattern polyfill
https://www.npmjs.com/package/urlpattern-polyfill
MIT License
267 stars 30 forks source link

Update path-to-regexp and implement pattern getters. #8

Closed wanderview closed 3 years ago

wanderview commented 3 years ago

The pull request is a first step towards updating the polyfill to the new URLPattern API as discussed in issue #7. There are two main changes:

  1. It updates the inlined path-to-regexp to the modified version found at: https://github.com/wanderview/path-to-regexp/tree/urlpattern-5-lenient
  2. It implements getters on URLPattern exposing the pattern for each component. The exposed patterns are normalized and may be different from the original values.

This pull request does not include tests. A future pull request will include an update set of tests based on the WPT test cases.