(path?: URL | string, ...paths: string[])
| 35 | * @returns The joined path. |
| 36 | */ |
| 37 | export function join(path?: URL | string, ...paths: string[]): string { |
| 38 | if (path === undefined) return "."; |
| 39 | if (path instanceof URL) { |
| 40 | path = fromFileUrl(path); |
| 41 | } |
| 42 | paths = path ? [path, ...paths] : paths; |
| 43 | paths.forEach((path) => assertPath(path)); |
| 44 | const joined = paths.filter((path) => path.length > 0).join("/"); |
| 45 | return joined === "" ? "." : normalize(joined); |
| 46 | } |
no test coverage detected