Refactor: update import paths for parseWinPath and integrate it into joinUrl function

This commit is contained in:
Elio Struyf
2025-02-12 12:41:22 +01:00
parent ee5af88851
commit d3b7f73c66
2 changed files with 3 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
import { isWindows } from '../utils';
import { isWindows } from '../utils/isWindows';
export const parseWinPath = (path: string | undefined): string => {
path = path?.split(`\\`).join(`/`) || '';

View File

@@ -1,4 +1,5 @@
import { urlJoin } from 'url-join-ts';
import { parseWinPath } from '../helpers';
export const joinUrl = (baseUrl: string | undefined, ...paths: any[]): string => {
const url = urlJoin(baseUrl, ...paths);
@@ -9,5 +10,5 @@ export const joinUrl = (baseUrl: string | undefined, ...paths: any[]): string =>
return url + '/';
}
return url;
return parseWinPath(url);
};