Module:OrdersData/Data: Difference between revisions
From Against the Storm Official Wiki
Anteprefix (talk | contribs) No edit summary |
Anteprefix (talk | contribs) No edit summary |
||
| Line 3: | Line 3: | ||
local JsonUtils = require("Module:JsonUtils") | local JsonUtils = require("Module:JsonUtils") | ||
local DATA_FILE = "Module:OrdersData/Orders.json" | local DATA_FILE = "Module:OrdersData/Orders.json" | ||
local SCHEMA = { | |||
ID = "id", | |||
} | |||
local newData = JsonUtils.convertJSONToLuaTable(DATA_FILE) | local newData = JsonUtils.convertJSONToLuaTable(DATA_FILE) | ||
Latest revision as of 08:21, 31 August 2025
Documentation for this module may be created at Module:OrdersData/Data/doc
--region Dependencies
local JsonUtils = require("Module:JsonUtils")
local DATA_FILE = "Module:OrdersData/Orders.json"
local SCHEMA = {
ID = "id",
}
local newData = JsonUtils.convertJSONToLuaTable(DATA_FILE)
--Promote the ID to be the key of the main data table.
ordersData = {}
for _, order in ipairs(newData) do
ordersData[order[SCHEMA.ID]] = order
end
return ordersData


