Module:Sandbox/MonkeysHK

local table = require('Module:Table') local data = mw.loadData('Module:Item/ApiData').items

local p = {}

function p.format local tb = {} for k, v in pairs(data) do		local name = v.name:upper:gsub(' ', '_'):gsub('\, '\\\) local id = v.id:upper:gsub(' ', '_'):gsub('\, '\\\) tb[name], tb[id] = k, k	end local sp = table.sortedPairs(tb, function(a, b)		return a < b	end) local ret = '' for k, v in sp do ret = ret .. ('\t[\'%s\'] = \'%s\',\n'):format(k, v)	end return ret end

return p