(Новая страница: «local store = "User:BombasterDS/uplink_store.json" return { store = mw.text.jsonDecode(mw.title.new(store, "User"):getContent()), }») |
Dantes (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
local | local jsonTitle = "User:BombasterDS/uplink_store.json" | ||
local content = mw.title.new(jsonTitle, "User"):getContent() or "{}" | |||
local ok, parsed = pcall(mw.text.jsonDecode, content) | |||
if not ok or type(parsed) ~= "table" then | |||
parsed = {} | |||
end | |||
return { | return { | ||
store = parsed | |||
} | } | ||
Текущая версия от 16:07, 16 октября 2025
Для документации этого модуля может быть создана страница Модуль:Uplink Lookup/data/doc
local jsonTitle = "User:BombasterDS/uplink_store.json"
local content = mw.title.new(jsonTitle, "User"):getContent() or "{}"
local ok, parsed = pcall(mw.text.jsonDecode, content)
if not ok or type(parsed) ~= "table" then
parsed = {}
end
return {
store = parsed
}