Module:ArgsUtil

-- From https://river.me/blog/frame-wtf, under CC-BY-SA 3.0

-- This module is two methods for reconciling parent and child frames, when you want to call functions in one module with another.

local p = {} -- snip function p.merge local f = mw.getCurrentFrame local origArgs = f.args local parentArgs = f:getParent.args

local args = {} for k, v in pairs(origArgs) do		v = mw.text.trim(tostring(v)) if v ~= '' then args[k] = v		end end for k, v in pairs(parentArgs) do		v = mw.text.trim(v) if v ~= '' then args[k] = v		end end return args end

function p.overwrite local f = mw.getCurrentFrame local origArgs = f.args local parentArgs = f:getParent.args

local args = {} for k, v in pairs(parentArgs) do		v = mw.text.trim(v) args[k] = v	end for k, v in pairs(origArgs) do		v = mw.text.trim(tostring(v)) args[k] = v	end return args end -- snip return p