Documentation for this module may be created at Module:Utils/doc
-- roblox.fandom.com
local get_args = require('Module:Arguments').getArgs
local p = {}
function p.wrap_function(f, ppc)
if ppc then
return function(frame)
mw.log('wrap_function (ppc=true): frame received:')
mw.logObject(frame)
if frame == nil then mw.log('wrap_function (ppc=true): frame == nil') end
local args = get_args(frame)
mw.log('wrap_function (ppc=true): args from get_args:')
mw.logObject(args)
return frame:preprocess(f(args))
end
else
return function(frame)
return f(get_args(frame))
end
end
end
return p