Модуль:IanComradeBot/prototypes/table.json/data: различия между версиями

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

Версия от 13:39, 4 февраля 2025

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

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