Skip to content

Commit 176777e

Browse files
committedOct 16, 2023
Wrap result of path.relative in toPosix
1 parent 6a1cbb3 commit 176777e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎src/util/path.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ export const cwd = toPosix(process.cwd());
1616
export const resolve = (...paths: string[]) =>
1717
paths.length === 1 ? path.posix.join(cwd, paths[0]) : path.posix.resolve(...paths);
1818

19-
export const relative = (from: string, to?: string) =>
20-
path.posix.relative(to ? toPosix(from) : cwd, toPosix(to ?? from));
19+
export const relative = (from: string, to?: string) => toPosix(path.relative(to ? from : cwd, to ?? from));
2120

2221
export const isInNodeModules = (filePath: string) => filePath.includes('node_modules');
2322

0 commit comments

Comments
 (0)
Please sign in to comment.