#heal-schemas
Functions
-
validate(schemaOrPath, val, [options]) ⇒
object
-
Returns true if yup validates, false if error.
-
isValid(schemaOrPath, val, [logger]) ⇒
boolean
-
Returns true if yup validates, false if error.
-
throwIfInvalid(value, schema) ⇒
Promise.<void>
-
Throw an error if value does not match schema.
object
validate(schemaOrPath, val, [options]) ⇒ Returns true if yup validates, false if error.
Kind: global function
Returns: object
- Plain object containing error and value keys.
If validation passes, value is the cleaned up value.
If validation fails, errors is a plain object
Param | Type | Default | Description |
---|---|---|---|
schemaOrPath |
object | string
|
yup schema object or dot-notation path to one in schemas | |
val | * |
|
The value to validate against the schema |
[options] | object |
boolean
isValid(schemaOrPath, val, [logger]) ⇒ Returns true if yup validates, false if error.
Kind: global function
Param | Type | Description |
---|---|---|
schemaOrPath |
object | string
|
yup schema object or dot-notation path to one in schemas |
val | * |
The value to validate against the schema |
[logger] | function |
If included, and validation fails, log errors with this function. |
Promise.<void>
throwIfInvalid(value, schema) ⇒ Throw an error if value does not match schema.
Kind: global function
Param | Type | Description |
---|---|---|
value | * |
value to validate against supplied schema |
schema | object |
yup schema |
[] | string |
errorMessage |