refact: uuid

This commit is contained in:
Thomas Lambert
2023-04-29 00:21:09 +02:00
parent 43408481a2
commit 4e2a433178
3 changed files with 33 additions and 32 deletions

View File

@@ -18,10 +18,4 @@ function M.strip(s, chars_to_remove)
return s:gsub("[" .. M.escape(chars_to_remove) .. "]", "")
end
-- strip an extension from a file name, escaping "." properly, eg:
-- strip_extension("path/Filename.md", ".md") -> "path/Filename"
local function strip_extension(str, ext)
return str:gsub("(" .. ext:gsub("%.", "%%.") .. ")$", "")
end
return M