Module:SS Medals

From JoJo's Bizarre Encyclopedia - JoJo Wiki
Jump to navigation Jump to search

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

local p = {}

function p.getTitle(jsonData, id)
    -- Parse JSON data
    local data = mw.text.json.decode(jsonData)
    
    -- Search for the entry with the given ID
    for _, entry in ipairs(data) do
        if entry.id == id then
            return entry.title
        end
    end
    
    return nil
end

return p