The object being validated.
Array of property values to exclude from validation.
The ObjectErrors instance
Validate multiple entity instances
class Invalid {
@IsDefined() p0: any = null;
}
let entities:Invalid[] = [ new Invalid(), new Invalid() ]
let oesArr:ObjectErrors[] = validateN(entities)
expect(oesArr[0].valid).toBeFalsy();
expect(oesArr[1].valid).toBeFalsy();
The array of entities to be validated.
The ObjectErrors
array which is empty if there are no errors
Validates a property contained on the object. Errors are added to the ObjectErrors, instance, unless skipErrorGeneration is true.
class Invalid {
@IsDefined() p0: any = null;
}
const I = new Invalid();
let oes = new ObjectErrors();
expect(validateProperty(I, 'p0', oes)).toBeFalsy();
const key = getPropertyKey(I, 'p0');
expect(oes.getErrors(key).length).toBeGreaterThan(0);
The object being validated
The name of the property holding the value being validated
The ObjectErrors instance used to collect ValidationErrors
Skips the generation of validation errors
true if the property is valid, false otherwise.
Generated using TypeDoc
Validates the
target
object.Example