You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validateMany currently returns an array of results ([null]), even if all subvalidations successfully pass. null should be returned directly to be consistent with validate and allow nesting of validate and validateMany calls.
validate({foo: [isRequired]})({foo: 'bar'});// === nullvalidateMany({foo: [isRequired]})([{foo: 'bar'}])// === [null], expected to be nullvalidate({arr: [validateMany({foo: [isRequired]})]})({arr: [{foo: 'bar'}]})// === {arr: [null]}, expected to be null
Of course when at least one validation fails, the structure should be kept as is to know which index is wrong.
validateMany
currently returns an array of results ([null]
), even if all subvalidations successfully pass.null
should be returned directly to be consistent withvalidate
and allow nesting ofvalidate
andvalidateMany
calls.Of course when at least one validation fails, the structure should be kept as is to know which index is wrong.
Proposed fix:
The text was updated successfully, but these errors were encountered: