Skip to content
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

Fix handling of Windows absolute paths. #315

Closed
wants to merge 1 commit into from

Conversation

matt1097
Copy link

This should fix #311
Added handling for absolute Windows file paths.

Added some additional tests around the url.fromFileSystemPath() to help catch this error in the future as no existing test was failing.

@meepen
Copy link

meepen commented Apr 4, 2023

Kind of wondering, why is this library doing all this weird stuff with checking for windows and manual path fixing when there's available libraries that do this all for us? For example, node's in-built path library

@sukeshpabolu
Copy link

Hi please merge this if possible

@gocarlos
Copy link

@jonluca anything preventing this from being merged?

@jonluca
Copy link
Collaborator

jonluca commented Sep 18, 2023

Kind of wondering, why is this library doing all this weird stuff with checking for windows and manual path fixing when there's available libraries that do this all for us? For example, node's in-built path library

Yeah I agree - I think I'd prefer to just go through and fix all these issues directly. Will take a look right now, and if I don't see a fast way of fixing it I'll merge in this PR.

* @returns
*/
export function isWindows() {
return /^win/.test(globalThis.process ? globalThis.process.platform : "");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason this is a function now, and not a constant? globalThis.process should never change during runtime?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah for the test, I see

@jonluca
Copy link
Collaborator

jonluca commented Sep 18, 2023

Thanks for the PR - I'm going to release a breaking change soon with changes that should fix what this is targeting. In general I think we should revamp the windows logic, like @meepen said.

@jonluca
Copy link
Collaborator

jonluca commented Sep 18, 2023

#321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect path resolving for absolut paths under windows
5 participants