parent
f410caf1ad
commit
ca8ec26b81
@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var formatWindowsRootFolder = function (path) {
|
||||
// Remove '.' from end of Windows root folder mapping e.g. 'E:.'
|
||||
if (path.length === 3
|
||||
&& path.charAt(1) === ':'
|
||||
&& path.charAt(2) === '.') {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
path = path.slice(0, -1);
|
||||
}
|
||||
return path;
|
||||
};
|
||||
var normJoinPath = function (_a) {
|
||||
var upath = _a.upath, paths = _a.paths;
|
||||
var path = upath.joinSafe.apply(upath, paths);
|
||||
path = formatWindowsRootFolder(path);
|
||||
return path;
|
||||
};
|
||||
exports.default = normJoinPath;
|
||||
@ -0,0 +1,28 @@
|
||||
const formatWindowsRootFolder = (path: string): string => {
|
||||
// Remove '.' from end of Windows root folder mapping e.g. 'E:.'
|
||||
if (
|
||||
path.length === 3
|
||||
&& path.charAt(1) === ':'
|
||||
&& path.charAt(2) === '.'
|
||||
) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
path = path.slice(0, -1);
|
||||
}
|
||||
|
||||
return path;
|
||||
};
|
||||
|
||||
const normJoinPath = ({
|
||||
upath,
|
||||
paths,
|
||||
}:{
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
upath: any,
|
||||
paths: string[]
|
||||
}):string => {
|
||||
let path = upath.joinSafe(...paths);
|
||||
path = formatWindowsRootFolder(path);
|
||||
return path;
|
||||
};
|
||||
|
||||
export default normJoinPath;
|
||||
Loading…
Reference in new issue