Line 325:
Line 325:
local success, data = pcall(function () return require(string.format("Module:%s", name)) end)
local success, data = pcall(function () return require(string.format("Module:%s", name)) end)
-- module without return (or empty, nil, false, true return) gives success = true, data = true
-- module without return (or empty, nil, false, true return) gives success = true, data = true
+
if data == true then
+
return false, nil
+
else
+
return success, data
+
end
+
end
+
+
function Utils.loadData(name)
+
local success, data = pcall(function () return mw.loadData(string.format("Module:%s", name)) end)
+
-- TODO: ???
if data == true then
if data == true then
return false, nil
return false, nil