1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Prevent not-equals from failing on fields that are both empty

This commit is contained in:
Andrew Kingston 2021-08-11 14:59:12 +01:00
parent 48059f6096
commit a3629ce68c

View file

@ -248,7 +248,11 @@ const equalHandler = (value, rule) => {
// Evaluates a not equal constraint
const notEqualHandler = (value, rule) => {
return !equalHandler(value, rule)
const ruleValue = parseType(rule.value, rule.type)
if (value == null && ruleValue == null) {
return true
}
return value !== ruleValue
}
// Evaluates a regex constraint