More actions
No edit summary |
No edit summary Tag: Reverted |
||
Line 7: | Line 7: | ||
if ppc then | if ppc then | ||
return function(frame) | 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 | end | ||
else | else |
Revision as of 22:35, 3 April 2025
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