Module:Sandbox/Ahecht/flag

This is an old revision of this page, as edited by Ahecht (talk | contribs) at 03:40, 12 June 2020 (test). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}
	
function p.main(frame)
	if ( (frame.args.alias or "") ~= "" ) then
		output = {}
	
		for k,v in pairs(frame.args) do
			if (v or '') ~= '' then
				output[#output+1] = '\t["' .. k .. '"] = ' .. v
			end
		end
		
		return '["' .. frame.args.alias .. '"] = {\n' .. table.concat(output,",\n") .. '\n},\n'
	end
end