(...segments: string[])
| 96 | * Note - must check posix first because win32.isAbsolute includes posix.isAbsolute |
| 97 | */ |
| 98 | export function properJoin(...segments: string[]): string { |
| 99 | if (path.posix.isAbsolute(segments[0])) { |
| 100 | return forceForwardSlashes(path.posix.join(...segments)); |
| 101 | } else if (path.win32.isAbsolute(segments[0])) { |
| 102 | return path.win32.join(...segments); |
| 103 | } else { |
| 104 | return path.join(...segments); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Resolves path segments properly based on whether they appear to be c:/ -style or / style. |
no test coverage detected