Status
@cuser/validator
Index
Classes
Functions
Functions
createValidator
▸ Const
createValidator(schema
: any): validate
Defined in validator.js:34
Creates a validator which raise a ValidationError when the object doesn't fit the schema
Parameters:
Name | Type | Description |
---|---|---|
schema |
any |
Returns: validate
Class: ValidationError
Validator error class with nested errors
Hierarchy
-
Error
↳ ValidationError
Index
Constructors
Constructors
constructor
+ new ValidationError(message
: any, validator
: ValidateFunction, value
: any): ValidationError
Defined in validator.js:15
Parameters:
Name | Type |
---|---|
message |
any |
validator |
ValidateFunction |
value |
any |
Returns: ValidationError