This commit is contained in:
Justin M. Keyes
2025-01-01 12:29:51 -08:00
committed by GitHub
parent 9d114b7205
commit dc692f553a
15 changed files with 151 additions and 113 deletions

View File

@@ -105,9 +105,13 @@ function M.basename(file)
return file:match('/$') and '' or (file:match('[^/]*$'))
end
--- Concatenates partial paths into one path. Slashes are normalized (redundant slashes are removed, and on Windows backslashes are replaced with forward-slashes)
--- (e.g., `"foo/"` and `"/bar"` get joined to `"foo/bar"`)
--- (windows: e.g `"a\foo\"` and `"\bar"` are joined to `"a/foo/bar"`)
--- Concatenates partial paths (one absolute or relative path followed by zero or more relative
--- paths). Slashes are normalized: redundant slashes are removed, and (on Windows) backslashes are
--- replaced with forward-slashes.
---
--- Examples:
--- - "foo/", "/bar" => "foo/bar"
--- - Windows: "a\foo\", "\bar" => "a/foo/bar"
---
---@since 12
---@param ... string