You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
path: make some @std/path functions work with file URL object #5537
As FS APIs in Deno works with file URL object, it would make sense to support file URL input with path.dirname.
dirname(newURL("file:///path/to/dir/file"))// returns `/path/to/dir` on unixdirname(newURL("file:///C:/path/to/dir/file"))// returns `C:\path\to\dir` on windows
This probably would throw with non-file URLs.
I think this mostly addresses the motivation we added std/url.
changed the title [-]path: make `dirname` work with file URL object[/-][+]path: make some `@std/path/posix` functions work with file URL object[/+]on Aug 2, 2024
changed the title [-]path: make some `@std/path/posix` functions work with file URL object[/-][+]path: make some `@std/path` functions work with file URL object[/+]on Aug 6, 2024
I think @std/path in its current state is good enough. Though, it's not a strong opinion of mine. @kt3k, do you still strongly believe we should have these additions? If yes, are you able to add them so we can progress with #5630?
I'd suggest we would target basename and normalize instead of resolve and relative for the remaining items as they are something exposed as std/url APIs.
We can revisit resolve and relative as they are requested
Activity
iuioiua commentedon Aug 2, 2024
Just
dirname()or the other functions too?kt3k commentedon Aug 2, 2024
I think this also makes sense for other functions such as
basename,extname,,commonjoin,relative, andresolve[-]path: make `dirname` work with file URL object[/-][+]path: make some `@std/path/posix` functions work with file URL object[/+][-]path: make some `@std/path/posix` functions work with file URL object[/-][+]path: make some `@std/path` functions work with file URL object[/+]kt3k commentedon Aug 6, 2024
I don't think we need to limit this to
std/path/posixas file URL object is platform independentiuioiua commentedon Aug 20, 2024
I think
@std/pathin its current state is good enough. Though, it's not a strong opinion of mine. @kt3k, do you still strongly believe we should have these additions? If yes, are you able to add them so we can progress with #5630?kt3k commentedon Aug 29, 2024
I'd suggest we would target
basenameandnormalizeinstead ofresolveandrelativefor the remaining items as they are something exposed asstd/urlAPIs.We can revisit
resolveandrelativeas they are requestediuioiua commentedon Aug 29, 2024
SGTM
kt3k commentedon Sep 4, 2024
done
build: remove all external deps