Re:Show HN: Parse no-protocol URL, no-domain URI and email a...
by felixfbecker on Friday June 14, 2019 @07:56AM
(#20182218)
Well in JS, it's called protocol
https://developer.mozilla.org/en-US/docs/Web/API/URL/protoco...
Re:Show HN: Parse no-protocol URL, no-domain URI and email a...
by JoBrad on Friday June 14, 2019 @08:04AM
(#20182260)
Node calls it a protocol scheme.
https://nodejs.org/dist/latest-v12.x/docs/api/url.html#url_u...
Re:Show HN: Parse no-protocol URL, no-domain URI and email a...
by noobiemcfoob on Friday June 14, 2019 @09:16AM
(#20182681)
Congratulations! You're all right!
Re:Show HN: Parse no-protocol URL, no-domain URI and email a...
by darrenf on Friday June 14, 2019 @08:43AM
(#20182493)
Interesting, thanks. I have virtually zero JS experience so didn't know that, and were I to try and pick it up this would've been a surprise to me - I naively assumed it would use the same terminology as the RFC and the libraries in languages with which I am familiar (rust, golang, python, perl). A quick look for the URI data type in a handful of other languages shows they also use "scheme". JS appears to be the outlier here.
Re:Show HN: Parse no-protocol URL, no-domain URI and email a...
by seandougall on Friday June 14, 2019 @10:52AM
(#20183480)
In particular, the scheme doesn't necessarily refer to a protocol (e.g. application-specific schemes like `chrome:` that don't involve network access at all).
To that end, you might also want to consider adding support for fragments. :)