open-index/open-npm huggingface dataset:
npm package: @sustainhawaii/heal-schemas
Description: schemas and validators for healthies collections
Author: Charles Koehl
Latest version: 3.27.4

#heal-schemas

## Functions

<dl>
<dt><a href="#validate">validate(schemaOrPath, val, [options])</a> ⇒ <code>object</code></dt>
<dd><p>Returns true if yup validates, false if error.</p>
</dd>
<dt><a href="#isValid">isValid(schemaOrPath, val, [logger])</a> ⇒ <code>boolean</code></dt>
<dd><p>Returns true if yup validates, false if error.</p>
</dd>
<dt><a href="#throwIfInvalid">throwIfInvalid(value, schema)</a> ⇒ <code>Promise.&lt;void&gt;</code></dt>
<dd><p>Throw an error if value does not match schema.</p>
</dd>
</dl>

<a name="validate"></a>

## validate(schemaOrPath, val, [options]) ⇒ <code>object</code>
Returns true if yup validates, false if error.

**Kind**: global function  
**Returns**: <code>object</code> - 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 | <code>object</code> \| <code>string</code> |  | yup schema object or dot-notation path to one in schemas |
| val | <code>\*</code> | <code></code> | The value to validate against the schema |
| [options] | <code>object</code> |  |  |

<a name="isValid"></a>

## isValid(schemaOrPath, val, [logger]) ⇒ <code>boolean</code>
Returns true if yup validates, false if error.

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| schemaOrPath | <code>object</code> \| <code>string</code> | yup schema object or dot-notation path to one in schemas |
| val | <code>\*</code> | The value to validate against the schema |
| [logger] | <code>function</code> | If included, and validation fails, log errors with this function. |

<a name="throwIfInvalid"></a>

## throwIfInvalid(value, schema) ⇒ <code>Promise.&lt;void&gt;</code>
Throw an error if value does not match schema.

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| value | <code>\*</code> | value to validate against supplied schema |
| schema | <code>object</code> | yup schema |
| [] | <code>string</code> | errorMessage |