Module:CargoUtil/Wiki

local h = {} local p = {}

p.objectTypes = { }

function p.castField(v, v_type) if p.objectTypes[v_type] then return p.objectTypes[v_type](v) end error('Unrecognized Cargo value casting type') end

function p.castComplexTypes(row, info) local objType = info.type local args = info.args local opts = {} for k, v in pairs(args) do		opts[k] = row[v] end error(('Unrecognized Cargo complex value casting type of %s'):format(objType)) end

return p