Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue # (if available)
#214
Description of changes
Adopt WHATWG URL Spec for ESM import syntax: https://nodejs.org/api/url.html#new-urlinput-base
Also noticed there was a bug in
URL.canParse()
and fixed it.Caveats
Original ticket: #195 requested
URL.parse
however this has been deprecated, https://nodejs.org/api/url.html#urlparseurlstring-parsequerystring-slashesdenotehost,though it does seem to be used fairly widely, a succinct description of the situation is here: nodejs/node#12682 (comment)
along with discussion within WHATWG here: whatwg/url#531
Future work
url
module helper functions:https://nodejs.org/api/url.html#urldomaintoasciidomain
https://nodejs.org/api/url.html#urldomaintounicodedomain
https://nodejs.org/api/url.html#urlfileurltopathurl
https://nodejs.org/api/url.html#urlpathtofileurlpath
https://nodejs.org/api/url.html#urlurltohttpoptionsurl
URLSearchParams.sort()
andURLSearchParams.keys()
URL.toJSON()
is needed and implement if it is.Checklist
tests/unit
and/or in Rust for my feature if neededmake fix
to format JS and apply Clippy auto fixesmake check
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.