joins multiple posix path segments into a single normalized path,
correctly handling files and directories differently when the "./" and "../" navigation commands are encountered.
Note
the joinPosixPaths function differs from joinSlash in that it treats segments without a trailing slash as files by default.
furthermore, joinPosixPaths is much more quicker to compute, as opposed to joinSlash, which uses some complex regex on each segment.
the only reason you might realistically want to use joinSlash is when you desire an non-normalized output.
joins multiple posix path segments into a single normalized path, correctly handling files and directories differently when the
"./"
and"../"
navigation commands are encountered.the
joinPosixPaths
function differs fromjoinSlash
in that it treats segments without a trailing slash as files by default. furthermore,joinPosixPaths
is much more quicker to compute, as opposed tojoinSlash
, which uses some complex regex on each segment. the only reason you might realistically want to usejoinSlash
is when you desire an non-normalized output.Example