Module:DataLoader

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to navigation Jump to search
Module documentation
This documentation is transcluded from Module:DataLoader/doc. [edit] [history] [purge]
local p = {}

function p.loadData(name)
    local title = mw.title.new(name)
    if not title.exists then
    	return mw.loadJsonData(name .. ".json")
    end
    if title.contentModel == "Scribunto" then
        return mw.loadData(name)
    elseif title.contentModel == "json" then
        return mw.loadJsonData(name)
    end
end

return p