Skip to content

Commit

Permalink
feat: add dict_merge() function (#1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi authored Sep 4, 2024
1 parent 322f5fc commit e3c6531
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yazi-plugin/preset/ya.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit e3c6531

Please sign in to comment.