@cuser/validator
v0.0.36
Published
json schema validator
Readme
Status
@cuser/validator
Index
Classes
Functions
Functions
createValidator
▸ ConstcreateValidator(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
