We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
webpro
Learn more about funding links in repositories.
Report abuse
path.relative
toPosix
1 parent 6a1cbb3 commit 176777eCopy full SHA for 176777e
src/util/path.ts
@@ -16,8 +16,7 @@ export const cwd = toPosix(process.cwd());
16
export const resolve = (...paths: string[]) =>
17
paths.length === 1 ? path.posix.join(cwd, paths[0]) : path.posix.resolve(...paths);
18
19
-export const relative = (from: string, to?: string) =>
20
- path.posix.relative(to ? toPosix(from) : cwd, toPosix(to ?? from));
+export const relative = (from: string, to?: string) => toPosix(path.relative(to ? from : cwd, to ?? from));
21
22
export const isInNodeModules = (filePath: string) => filePath.includes('node_modules');
23
0 commit comments