Module:Sandbox/Andrewds1021

local p = {}

local getArgs = require("Dev:Arguments")["getArgs"]

function p.main(frame) -- attempt to determine if provided with valid frame object local no_frame = not (type(frame.preprocess) == "function") -- - retrieve arguments - if no valid frame object, assume table of arguments -- local raw_args, args if no_frame then raw_args = frame args = mw.clone(frame) for k, v in pairs(args) do           if type(v) == "string" then v = v:match("^%s*(.-)%s*$") if v == "" then v = nil end args[k] = v           end end else raw_args = getArgs(frame, {trim = false, removeBlanks = false}) args = getArgs(frame) end local result = "" for k, v in pairs(args) do       result = result .. ", " .. k .. " = " .. v   end return result:sub(2) end

return p