mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 07:13:45 +01:00
Fix table values constraint in schema validation
This commit is contained in:
parent
d2183f2357
commit
ff7f0e1d2d
@ -318,7 +318,11 @@ function load(self, override, params)
|
|||||||
end
|
end
|
||||||
assert((not self.list) or modlib.table.count(override) == #override, "list")
|
assert((not self.list) or modlib.table.count(override) == #override, "list")
|
||||||
end
|
end
|
||||||
|
-- Apply the values check only for primitive types where table indexing is by value;
|
||||||
|
-- the `values` field has a different meaning for tables (constraint all values must fulfill)
|
||||||
|
if self.type ~= "table" then
|
||||||
assert((not self.values) or self.values[override], "values")
|
assert((not self.values) or self.values[override], "values")
|
||||||
|
end
|
||||||
if self.func then self.func(override) end
|
if self.func then self.func(override) end
|
||||||
return override
|
return override
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user