# @clocklimited/validity-compose

> Compose a number of validators together to use as one

Latest version **1.0.3** (published 2022-04-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install @clocklimited/validity-compose
pnpm add @clocklimited/validity-compose
yarn add @clocklimited/validity-compose
bun add @clocklimited/validity-compose
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-04-04 |
| First published | 2022-04-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Paul Serby |
| Maintainers | steepnicki, wesmoore, benparnell, jack828, asheboy, microadam, ndumato |

## Links

- npm: https://www.npmjs.com/package/@clocklimited/validity-compose
- Repository: https://github.com/clocklimited/validity-compose
- Homepage: https://github.com/clocklimited/validity-compose#readme
- Issues: https://github.com/clocklimited/validity-compose/issues
- npm.io page: https://npm.io/package/@clocklimited/validity-compose

## Dependencies (1)

- [async-each-series](https://npm.io/package/async-each-series.md) ^1.1.0

## Recent versions

- 1.0.3 (latest) — 2022-04-04

## README

# validity-compose

Compose a number of validators together and call as a single validator. This is
useful when used with a conditional validator.

This used to be called `validity-validation-group`

## Installation

```
npm install --save @clocklimited/validity-compose
```

## Usage

Below is a simple example for usage with schemata and save:

``` js
var validity = require('@clocklimited/validity')
  , schemata = require('schemata')
  , compose = require('@clocklimited/validity-compose')

var schema = schemata(
    { type:
      { type: String
      }
    , url:
      { type: String
      , validators: { all: [ validateIfPropertyIn('type', ['a', 'b'], compose([ validity.required, validity.url ]) ] }
      }
    })
```

---
_Source: https://npm.io/package/@clocklimited/validity-compose · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
