Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion ProfileStore.luau
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,19 @@ local function SessionToken(store_name, profile_key, is_mock)

end

local function CopyBuffer(b)
local new = buffer.create(buffer.len(b))
buffer.copy(new, 0, b)
return new
end

local function DeepCopyTable(t)
local copy = {}
for key, value in pairs(t) do
if type(value) == "table" then
copy[key] = DeepCopyTable(value)
elseif type(value) == "buffer" then
copy[key] = CopyBuffer(value)
else
copy[key] = value
end
Expand All @@ -411,6 +419,8 @@ local function ReconcileTable(target, template)
if target[k] == nil then
if type(v) == "table" then
target[k] = DeepCopyTable(v)
elseif type(v) == "buffer" then
target[k] = CopyBuffer(v)
else
target[k] = v
end
Expand Down Expand Up @@ -2240,4 +2250,4 @@ task.spawn(function()

end)

return ProfileStore
return ProfileStore