3 ms·
`src` takes a path, not a URL. I think you just misunderstand what a URL is.
by philipwhiuk 2y ago
`src` takes a path, not a URL.
I think you just misunderstand what a URL is.
- deathanatos 2y agoI would think of it as a "URI-reference" (a URL or a relative ref), since `src` can be thinks like "https://example.com/test.png https://example.com/test.png" (absolute URI, not a path) or "//example.com/foo.png" (relative, not a path). The bigger point is yeah, type T isn't a parser for type U. I guess unfortunately, I'm not sure if there is a URI-ref parser in JS that I know of … but does one ever want to do that, without first normalizing it over a base URI?