@sustainhawaii/heal-schemas

3.27.4 • Public • Published

#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.

validate(schemaOrPath, val, [options]) ⇒ object

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

isValid(schemaOrPath, val, [logger]) ⇒ boolean

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.

throwIfInvalid(value, schema) ⇒ Promise.<void>

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

Readme

Keywords

none

Package Sidebar

Install

npm i @sustainhawaii/heal-schemas

Weekly Downloads

0

Version

3.27.4

License

WTFPL

Unpacked Size

86.4 kB

Total Files

21

Last publish

Collaborators

  • nidhinmathew
  • basavarajaut
  • abhisustain
  • muralisustain
  • anirsustain
  • cksh