mirror of
https://github.com/Michatec/ptelevision.git
synced 2026-03-31 23:46:30 +02:00
11 lines
359 B
Lua
11 lines
359 B
Lua
Inventory = exports.ox_inventory
|
|
|
|
function DumpArray(obj, seen)
|
|
if type(obj) ~= 'table' then return obj end
|
|
if seen and seen[obj] then return seen[obj] end
|
|
local s = seen or {}
|
|
local res = setmetatable({}, getmetatable(obj))
|
|
s[obj] = res
|
|
for k, v in pairs(obj) do res[DumpArray(k, s)] = DumpArray(v, s) end
|
|
return res
|
|
end |