Module:FileExists: Difference between revisions

From EarthMC
Jump to navigation Jump to search
(Created page with "local p = {} function p.fileExists(filename) local title = mw.title.new(filename, 'File') if not title then return false end return title. Exists end return p")
 
mNo edit summary
 
Line 7: Line 7:
     end
     end


     return title. Exists
     return title.exists
end
end


return p
return p

Latest revision as of 14:21, 21 October 2023

Documentation for this module may be created at Module:FileExists/doc

local p = {}

function p.fileExists(filename)
    local title = mw.title.new(filename, 'File')
    if not title then
        return false
    end

    return title.exists
end

return p