Module:DatasetLoader: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
Line 14: Line 14:
     end
     end


     -- Fallback to mw.loadData for Data: namespace
     -- Fallback to mw.loadJsonData for Data: namespace
     local ok2, data2 = pcall(mw.loadData, 'Data:' .. name .. '.json')
     if mw.loadJsonData then
    if ok2 and data2 then
        local ok2, data2 = pcall(mw.loadJsonData, 'Data:' .. name .. '.json')
        return data2
        if ok2 and data2 and type(data2) == 'table' then
            return data2
        end
     end
     end