Skip to content

Commit

Permalink
fix: path parsing on the Windows platform
Browse files Browse the repository at this point in the history
closed: unjs#225
  • Loading branch information
13OnTheCode committed Aug 14, 2023
1 parent ce69bac commit cdc4c37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/error.ts
@@ -1,12 +1,12 @@
import { sep } from "node:path";

export function parseStack(stack: string) {
const cwd = process.cwd() + sep;
const cwd = (process.cwd() + sep).split(sep).join('/');

const lines = stack
.split("\n")
.splice(1)
.map((l) => l.trim().replace("file://", "").replace(cwd, ""));
.map((l) => l.trim().replace(/file:\/\/\/?/, "").replace(cwd, ""));

return lines;
}

0 comments on commit cdc4c37

Please sign in to comment.