Модуль:IanComradeBot/ftl/ru-RU.json/data: различия между версиями

Материал из Space Station 14 Вики
Новая страница: «local title = mw.title.new("User:IanComradeBot/ftl/ru-RU.json", "User") local content = title and title:getContent() or "" local success, data = pcall(mw.text.jsonDecode, content) if not success or type(data) ~= "table" then data = {} end return data»
 
мНет описания правки
Строка 1: Строка 1:
local title = mw.title.new("User:IanComradeBot/ftl/ru-RU.json", "User")
local title = mw.title.new("Участник:IanComradeBot/prototypes/accent.json")
local content = title and title:getContent() or ""
local jsonData = title and title:getContent() or ""
 
local success, data = pcall(mw.text.jsonDecode, jsonData)
local success, data = pcall(mw.text.jsonDecode, content)
return (success and type(data) == "table") and data or {}
if not success or type(data) ~= "table" then
    data = {}
end
 
return data

Версия от 23:17, 15 апреля 2025

Для документации этого модуля может быть создана страница Модуль:IanComradeBot/ftl/ru-RU.json/data/doc

local title = mw.title.new("Участник:IanComradeBot/prototypes/accent.json")
local jsonData = title and title:getContent() or ""
local success, data = pcall(mw.text.jsonDecode, jsonData)
return (success and type(data) == "table") and data or {}