Closed gsouf closed 3 years ago
That's a great idea! I hadn't realised there was a difference between the old node url.parse
method and the new URL constructor but it would make sense to support URL objects.
I've tested this and it seems to be working with Node 8 and in browsers. I think the URL is being converted into a string and then parsed correctly. What platform are you getting the error on?
Hi,
With version we could use url objects that way:
With version 2 it's no longer possible and for this reason existing code breaks when upgrading.
The reason is that
URL.parse(url)
that was used in version 1 accepts URL object as parameter whennew URL.URL(url)
does not.Can we consider adding back the support for url objects?