mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +01:00
Add table.default
This commit is contained in:
parent
e346128d4d
commit
d2b6b4ec64
@ -18,6 +18,14 @@ function from_iterator(...)
|
||||
return table
|
||||
end
|
||||
|
||||
function default(table, value)
|
||||
return setmetatable(table, {
|
||||
__index = function()
|
||||
return value
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
function map_index(table, func)
|
||||
local mapping_metatable = {
|
||||
__index = function(table, key)
|
||||
|
Loading…
Reference in New Issue
Block a user