- From: 一丝 <notifications@github.com>
- Date: Wed, 17 Apr 2024 05:01:10 -0700
- To: whatwg/url <url@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 17 April 2024 12:01:15 UTC
If you have the following code, the url actually needs to be parsed twice. ```js const url = 'http://foo.com' if (URL.canParse(url)) { return new URL(url) } ``` Looking back, now that we've added `URL.parse()` to return null if it's invalid(https://github.com/whatwg/url/pull/825), why do we need `URL.canParse()`? -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/url/issues/713#issuecomment-2061096040 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/url/issues/713/2061096040@github.com>
Received on Wednesday, 17 April 2024 12:01:15 UTC