• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
no edit summary
Line 175: Line 175:  
function Utils.requireModule(name)
 
function Utils.requireModule(name)
 
     return pcall(function () return require(string.format("Module:%s", name)) end)
 
     return pcall(function () return require(string.format("Module:%s", name)) end)
 +
end
 +
 +
-- * Testing functions.
 +
 +
function Utils.debugPrint(x, i)
 +
    i = i or 0
 +
    if type(x) == "table" then
 +
        for k, v in pairs(x) do
 +
            mw.log(
 +
                string.rep("  ", i) .. tostring(k) .. " : " .. type(k) .. " = " ..
 +
                (type(v) == "table" and "table" or tostring(v) .. " : " .. type(v))
 +
            )
 +
            if type(v) == "table" then
 +
                debugPrint(v, i + 1)
 +
            end
 +
        end
 +
    else
 +
        mw.log(tostring(x) .. " : " .. type(x))
 +
    end
 
end
 
end
  
cssedit, gkautomate
7,064

edits

Navigation menu