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

Материал из Space Station 14 Вики
Нет описания правки
мНет описания правки
Строка 1: Строка 1:
local data = "User:IanComradeBot/prototypes/fills/Item.json"
local title = mw.title.new("User:IanComradeBot/prototypes/fills/Item.json", "User")
 
local jsonData = title and title:getContent() or ""
return {
local success, data = pcall(mw.text.jsonDecode, jsonData)
data = mw.text.jsonDecode(mw.title.new(data, "User"):getContent())
return (success and type(data) == "table") and data or {}
}

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

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

local title = mw.title.new("User:IanComradeBot/prototypes/fills/Item.json", "User")
local jsonData = title and title:getContent() or ""
local success, data = pcall(mw.text.jsonDecode, jsonData)
return (success and type(data) == "table") and data or {}