mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
refactor: simplify charm sync validation
This commit is contained in:
parent
7bb6edb403
commit
dffeb35933
7 changed files with 48 additions and 74 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue