fix: Failed to construct 'URL': Invalid URL everytime the URL is modified (#2897)

* fix: Failed to construct 'URL': Invalid URL everytime the URL is modified

A non-parsable URL should be an acceptable state while the text is being typed.

* chore: path params are returned as empty

---------

Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
This commit is contained in:
Mateusz Pietryga 2024-08-27 08:49:04 +02:00 committed by GitHub
parent 4ddccefee3
commit ad388e5a6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,7 +44,8 @@ export const parsePathParams = (url) => {
try {
uri = new URL(uri);
} catch (e) {
throw e;
// URL is non-parsable, is it incomplete? Ignore.
return [];
}
let paths = uri.pathname.split('/');