[F] joinPaths
function joinPaths(path, ...paths): string
Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified.
// Non-rootedjoinPaths("path", "to", "file.ext") === "path/to/file.ext"joinPaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext"// POSIXjoinPaths("/path", "to", "file.ext") === "/path/to/file.ext"joinPaths("/path", "/to", "file.ext") === "/to/file.ext"// DOSjoinPaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext"joinPaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext"// URLjoinPaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext"joinPaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext"
Parameters
Parameter | Type |
---|---|
path | string |
…paths | (undefined | string )[] |
Returns
string