Jump to content

Module:Road data/dump

From Wikipedia, the free encyclopedia
local p = {}

-- Import module function to work with passed arguments
local getArgs = require('Module:Arguments').getArgs

local util = require("Module:Road data/util")

function p._dump(args)
	local name = mw.ustring.gsub(args.module, ".*/(%w+)$", "%1")
	local output = mw.ustring.format("%s = {\n%s\n}",
		name,
		util.arrayToString(require(args.module), 4))
	mw.log(output)
	return output
end

function p.dump(frame)
	local args = getArgs(frame)
	return p._dump(args, frame)
end

return p