Skip to content

Commit d0ed2aa

Browse files
committed
refactor(utils): remove now unneeded toRelative option from toUnixPath
1 parent fe4a38c commit d0ed2aa

2 files changed

Lines changed: 2 additions & 19 deletions

File tree

packages/utils/src/lib/transform.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,8 @@ export function objectToCliArgs<
105105
});
106106
}
107107

108-
export function toUnixPath(
109-
path: string,
110-
options?: { toRelative?: boolean },
111-
): string {
112-
const unixPath = path.replace(/\\/g, '/');
113-
114-
if (options?.toRelative) {
115-
return unixPath.replace(`${process.cwd().replace(/\\/g, '/')}/`, '');
116-
}
117-
118-
return unixPath;
108+
export function toUnixPath(path: string): string {
109+
return path.replace(/\\/g, '/');
119110
}
120111

121112
export function toUnixNewlines(text: string): string {

packages/utils/src/lib/transform.unit.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,6 @@ describe('toUnixPath', () => {
181181
])('should transform "%s" to valid slug "%s"', (path, unixPath) => {
182182
expect(toUnixPath(path)).toBe(unixPath);
183183
});
184-
185-
it('should transform absolute Windows path to relative UNIX path', () => {
186-
expect(
187-
toUnixPath(`${process.cwd()}\\windows\\path\\config.ts`, {
188-
toRelative: true,
189-
}),
190-
).toBe('windows/path/config.ts');
191-
});
192184
});
193185

194186
describe('capitalize', () => {

0 commit comments

Comments
 (0)