refactor: simplify charm sync validation

This commit is contained in:
littensy 2025-11-04 22:30:10 -08:00
parent 7bb6edb403
commit dffeb35933
7 changed files with 48 additions and 74 deletions

View file

@ -74,15 +74,13 @@ local function diff(currentState: any, nextState: any): any
end
if config.fixArrays then
-- Coerce sparse array patches into dictionaries
-- Convert sparse array patches that could be misserialized
if currentState[1] ~= nil or nextState[1] ~= nil then
patches = stringifySparseArray(patches)
end
if globals.strict and config.validatePatches then
for key, value in patches do
validate(value, key)
end
validate(patches)
end
end