objectProps
The objectProps
validator performs validation on every object property for which validators are defined. The validators are supplied as an object with the shape matching the object.
Parameters
The first parameter to the objectProps
validator factory is an object defining the properties to be validated on objects. Validator props can also be supplied either as an object or as a function that accepts context and returns a validator props object.
Validation Context
When validation context needs to be supplied to specific validators, an objectProps
context can be used with a shape matching how the context should be applied.
Result Properties
objectProps
: An object with properties matching those validated, with the values of the properties representing the validation results produced during validation
The objectProps
validator adds an objectProps
property to the validation result with validation results of every property that was validated in the object's validators. The validation result property is named objectProps
to match the name of the validator (this is a common pattern in Strickland).
Last updated
Was this helpful?