Module:Data/sandbox: Difference between revisions
Jump to navigation
Jump to search
en>Pppery (Undid revision 947738882 by 2A01:CB04:4AC:2300:1975:F518:CB7A:FA9 (talk) CLearly not an attempt at sandboxing a change to Module:Data) |
m (1 revision imported) |
||
(No difference)
| |||
Latest revision as of 08:21, 15 March 2023
Documentation for this module may be created at Module:Data/sandbox/doc
local mt = {}
function mt.__index(t, k)
if string.sub(k, 1, 7) ~= "Module:" then
k = "Module:" .. k
end
return function(frame)
local data = mw.loadData(k)
for _,v in ipairs(frame.args) do
data = data[v]
end
return data
end
end
return setmetatable({}, mt)