-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(url): release url@1.0.0
#4992
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4992 +/- ##
=======================================
Coverage 95.82% 95.82%
=======================================
Files 458 458
Lines 37853 37853
Branches 5563 5563
=======================================
Hits 36272 36272
Misses 1541 1541
Partials 40 40 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the basename
behaviour makes sense - we should not stabilize it.
Namely the fact that it is really
import { basename } from "@std/path/posix";
if (url.path !== "/") {
return basename(url.path);
} else {
return url.hostname;
}
Additionally, the connotation that url.*
methods operates on a URL is not really correct. It operates on URLs that have posix formatted paths. This is weird, because not all URLs have posix formatted paths. Take for example data URLs:
> new URL("data:application/javascript,1+1;")
URL {
href: "data:application/javascript,1+1;",
origin: "null",
protocol: "data:",
username: "",
password: "",
host: "",
hostname: "",
port: "",
pathname: "application/javascript,1+1;",
hash: "",
search: ""
}
This is not a posix formatted path.
Because of this, I think that really we shouldn't be doing this - we should just document that people can use join
, basename
, and friends from @std/path/posix
.
Frankly, the purpose of |
Perhaps, one of the only things |
Closing as we're instead removing |
To be merged July 7.
Closes #4924