Module:Nation Stats

local stat = mw.loadData('Module:Nation Stats/data')

local p = {}

function p.getStat(frame) local args = frame:getParent.args if not args[1] then error("Missing required parameter: Nation") end if not args[2] then error("Missing required paramenter: Statistic") end local country = args[1]:lower local key = args[2]:upper if not stat[country] then error(("Parameter %s not found in lookup table"):format(args[1])) end return stat[country][key] end

return p