mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-24 00:01:03 +00:00
feat: add dict_merge() function (#1609)
This commit is contained in:
parent
322f5fc230
commit
e3c653154f
1 changed files with 6 additions and 1 deletions
|
|
@ -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" }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue