feat: add sync validation

This commit is contained in:
Richard 2024-02-28 21:24:24 -08:00
parent 23dc1ad855
commit d8d0c2a1f8
5 changed files with 166 additions and 0 deletions

View file

@ -1,3 +1,5 @@
local validate = require(script.Parent.validate)
local NONE = { __none = "__none" }
local function diff(previousState: { [any]: any }, nextState: { [any]: any })
@ -15,6 +17,15 @@ local function diff(previousState: { [any]: any }, nextState: { [any]: any })
end
end
if _G.__DEV__ then
for key, value in previousState do
validate(value, key, warn)
end
for key, value in nextState do
validate(value, key, warn)
end
end
return patch
end