Module:Road data/dump

< Module:Road data
Revision as of 05:40, 16 July 2021 by Zoran (talk | contribs) (Pywikibot 6.4.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Road data/dump/doc

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