feat: add dict_merge() function

This commit is contained in:
sxyazi 2024-09-04 21:44:02 +08:00
parent 322f5fc230
commit 409a868366
No known key found for this signature in database

View file

@ -21,7 +21,12 @@ function ya.list_merge(a, b)
return a
end
function ya.basename(s) return s:gsub("(.*[/\\])(.*)", "%2") end
function ya.dict_merge(a, b)
for k, v in pairs(b) do
a[k] = v
end
return a
end
function ya.readable_size(size)
local units = { "B", "K", "M", "G", "T", "P", "E", "Z", "Y", "R", "Q" }