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

Should pathe parse have the same return logic like node:path parse #167

Open
prisis opened this issue Mar 24, 2024 · 0 comments · May be fixed by #168
Open

Should pathe parse have the same return logic like node:path parse #167

prisis opened this issue Mar 24, 2024 · 0 comments · May be fixed by #168

Comments

@prisis
Copy link

prisis commented Mar 24, 2024

Environment

Package Version: 1.1.2
Node: v21.7.1
OS: Windows (Tested)

Reproduction

Node path

path.parse(".\\dir\\file")  -> { 
  root: '',
  dir: '.\\dir',
  base: 'file',
  ext: '',
  name: 'file' 
}

path.parse("C:\\path\\dir\\file.txt")  -> {
    root: "C:/",
    dir: "C:/path/dir",
    base: "file.txt",
    ext: ".txt",
    name: "file",
  }

Pathe

parse(".\\dir\\file")  -> {
    root: ".",
    dir: "./dir",
    base: "file",
    ext: "",
    name: "file",
  }

parse("C:\\path\\dir\\file.txt") -> {
    root: "C:",
    dir: "C:/path/dir",
    base: "file.txt",
    ext: ".txt",
    name: "file",
  }

Describe the bug

Im expecting the same result like nodes path.parse but with normalize path

Additional context

Will adjust the PR based on the ticket comments how to handle the return value of root

Logs

No response

@prisis prisis linked a pull request Mar 24, 2024 that will close this issue
8 tasks
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 a pull request may close this issue.

1 participant