/**
* Returns a boolean indicating whether the given URL string
* can be parsed into a `URL` instance.
* A substitute for `URL.canParse()` for Node.js 18.
*/
export functioncanParseUrl(url: string): boolean{
try {
newURL(url)
returntrue
} catch (_error) {
returnfalse
}
}