urlpattern-polyfill
urlpattern-polyfill copied to clipboard
URLPattern polyfill
Related to https://github.com/WICG/urlpattern/issues/148. This PR adds support for case-insensitive match for `pathname`. It adds a `caseSensitivePath` flag to the init object. Example: ```ts import { strictEqual } from 'assert'; const...
Hi, Thank you for the polyfill, it works in latest environments but when dealing with older node versions, babel versions... it may fail to compile due to 1 nullish coalescing...
The c++ native implementation now has a URLPattern.compareComponent() static method. See: * https://bugs.chromium.org/p/chromium/issues/detail?id=1232795 * https://github.com/WICG/urlpattern/issues/61 This part of the API is not as stable as the rest and may still...
``` const p = new URLPattern({ pathname: "/api/Artworks/:id", baseURL: "http://localhost" }) const u = new URL("http://localhost/api/Artworks/1?a=1") console.log(p.test(u)) ```
This makes the types closer to the behavior of the polyfill and the Chrome implementation by using a discriminated union to determine if the second arg is allowed, and then...
Thank you very much for this library, it makes my router program elegant! I've discovered that URLPattern doesn't work according to web standards when the pathname contains the leading `//`...
urlpattern spec now has ignore case I believe its supported in chrome since 107 https://chromestatus.com/feature/5206436850696192 dictionary URLPatternOptions { [boolean](https://webidl.spec.whatwg.org/#idl-boolean) ignoreCase = false; }; any plans to support it in the...
In https://github.com/whatwg/urlpattern/pull/188, the URL Pattern API was updated to use `v` flag instead of `u`. As mentioned in the [blink-dev thread](https://groups.google.com/a/chromium.org/g/blink-dev/c/yW453lPWjpc), the expected impact is very limited. It would be...
Platform: macOS Architecture: `arm64` Node: `v18.18.0` The double-star syntax is unnecessary, since it also works with a single star, but I still want to report this to hopefully get it...
Though the method exists, type definition do not have it.