Skip to content

Commit

Permalink
Wrap result of path.relative in toPosix
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 16, 2023
1 parent 9fd764b commit 4b64cc9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/util/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export const cwd = toPosix(process.cwd());
export const resolve = (...paths: string[]) =>
paths.length === 1 ? path.posix.join(cwd, paths[0]) : path.posix.resolve(...paths);

export const relative = (from: string, to?: string) =>
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));

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

Expand Down

0 comments on commit 4b64cc9

Please sign in to comment.