Модуль:JsonPaths: различия между версиями

Материал из Space Station 14 Вики
Новая страница: «local p = {} function p.get(rel, BD) if type(rel) ~= "string" or rel == "" then return "" end if (not BD or BD == "") and mw.getCurrentFrame then local frame = mw.getCurrentFrame() BD = (frame.args and frame.args.BD) or "" end local prefix = "Module:IanComradeBot/" if BD and BD ~= "" then prefix = prefix .. BD .. "/" end return prefix .. rel .. "/data" end return p»
 
Нет описания правки
Строка 1: Строка 1:
local p = {}
local p = {}


function p.get(rel, BD)
function p.get(rel, path)
     if type(rel) ~= "string" or rel == "" then
     if type(rel) ~= "string" or rel == "" then
         return ""
         return ""
     end
     end


     if (not BD or BD == "") and mw.getCurrentFrame then
     if (not path or path == "") and mw.getCurrentFrame then
         local frame = mw.getCurrentFrame()
         local frame = mw.getCurrentFrame()
         BD = (frame.args and frame.args.BD) or ""
         path = (frame.args and frame.args.path) or ""
    end
 
    if path == "Corvax" then
        path = ""
     end
     end


     local prefix = "Module:IanComradeBot/"
     local prefix = "Module:IanComradeBot/"
     if BD and BD ~= "" then
     if path and path ~= "" then
         prefix = prefix .. BD .. "/"
         prefix = prefix .. path .. "/"
     end
     end



Версия от 01:16, 20 марта 2026

Для документации этого модуля может быть создана страница Модуль:JsonPaths/doc

local p = {}

function p.get(rel, path)
    if type(rel) ~= "string" or rel == "" then
        return ""
    end

    if (not path or path == "") and mw.getCurrentFrame then
        local frame = mw.getCurrentFrame()
        path = (frame.args and frame.args.path) or ""
    end

    if path == "Corvax" then
        path = ""
    end

    local prefix = "Module:IanComradeBot/"
    if path and path ~= "" then
        prefix = prefix .. path .. "/"
    end

    return prefix .. rel .. "/data"
end

return p