Open
Description
What is the problem this feature will solve?
It's a nice way to accept both URL
and path string in API, but we need covert it to either string or URL, it would be nice to have a built-in method to do this.
What is the feature you are proposing to solve the problem?
For converting to string:
Maybe add path.from(URL | string)
? @sindresorhus proposed here.
For converting to URL:
url.from(URL | string)
I'm not sure, since URL
is a standard, I guess adding method URL
object won't be acceptable, maybe to node:url
module?
What alternatives have you considered?
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Triaged