Jump to content

Module:Road data/dump

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Chinissai (talk | contribs) at 00:58, 30 April 2016 (Return output.). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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