* Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. * * ```ts * // Non-rooted * combinePaths("path", "to", "file.ext") === "path/to/file.ext" * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file
(path)
| 7920 | * ``` |
| 7921 | */ |
| 7922 | function combinePaths(path) { |
| 7923 | var paths = []; |
| 7924 | for (var _i = 1; _i < arguments.length; _i++) { |
| 7925 | paths[_i - 1] = arguments[_i]; |
| 7926 | } |
| 7927 | if (path) |
| 7928 | path = normalizeSlashes(path); |
| 7929 | for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { |
| 7930 | var relativePath = paths_1[_a]; |
| 7931 | if (!relativePath) |
| 7932 | continue; |
| 7933 | relativePath = normalizeSlashes(relativePath); |
| 7934 | if (!path || getRootLength(relativePath) !== 0) { |
| 7935 | path = relativePath; |
| 7936 | } |
| 7937 | else { |
| 7938 | path = ensureTrailingDirectorySeparator(path) + relativePath; |
| 7939 | } |
| 7940 | } |
| 7941 | return path; |
| 7942 | } |
| 7943 | ts.combinePaths = combinePaths; |
| 7944 | /** |
| 7945 | * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any |
no test coverage detected