Minetest-WorldEditAdditions/worldeditadditions/utils/tables/table_apply.lua
Starbeamrainbowlabs db7b20d485
Refactor table functions into subtable of wea
Also, you can return a value from dofile()!!!!

This changes everything.
2021-06-28 00:56:29 +01:00

12 lines
371 B
Lua

--- SHALLOW ONLY - applies the values in source to overwrite the equivalent keys in target.
-- Warning: This function mutates target!
-- @param source table The source to take values from
-- @param target table The target to write values to
local function table_apply(source, target)
for key, value in pairs(source) do
target[key] = value
end
end
return table_apply