You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
280 B
Lua
17 lines
280 B
Lua
2 years ago
|
return
|
||
|
{
|
||
|
--- Define a metatable.
|
||
|
--- @param template table the default value
|
||
|
new = function(template)
|
||
|
-- set self to `template`, or `{}` if nil.
|
||
|
local self = template or {}
|
||
|
|
||
|
-- set `__index`.
|
||
|
if not self.__index then
|
||
|
self.__index = self
|
||
|
end
|
||
|
|
||
|
return self
|
||
|
end,
|
||
|
}
|