# @perfect-schema/standard-validators

> Standard validators for Perfect Schema

Latest version **2.3.0** (published 2019-02-19) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @perfect-schema/standard-validators
pnpm add @perfect-schema/standard-validators
yarn add @perfect-schema/standard-validators
bun add @perfect-schema/standard-validators
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2019-02-19 |
| First published | 2018-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.2.1 |
| Dependencies | 0 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Yanick Rochon |
| Maintainers | yanickrochon |
| Keywords | perfect-schema, model, schema, validation |

## Links

- npm: https://www.npmjs.com/package/@perfect-schema/standard-validators
- Repository: https://github.com/perfect-schema/standard-validators
- Homepage: https://github.com/perfect-schema/standard-validators#readme
- Issues: https://github.com/perfect-schema/standard-validators/issues
- npm.io page: https://npm.io/package/@perfect-schema/standard-validators

## Alternatives

- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads

## Recent versions

- 2.3.0 (latest) — 2019-02-19
- 2.2.2 — 2019-02-16
- 2.2.1 — 2018-09-22
- 2.2.0 — 2018-09-17

## README

# Perfect Schema Standard Validatiors Plugin

Provide standard validation for schemas.


## Install

```
npm i -S @perfect-schema/standard-validators
```


## Usage

```js
import PerfectSchema from '@perfect-schema/base';
import { 
  matchValidator,
  restrictedValuesValidator
} from '@perfect-schema/standard-validators';


PerfectSchema.use(matchValidator);
PerfectSchema.use(restrictedValuesValidator);

const schema = new PerfectSchema({
  foo: {
    type: String,
    match: /[a-z0-9]+/i
  },
  bar: {
    type: Number,
    restrictedValues: [2, 3, 5, 7, 11, 13, 17, 19]
  }
});
```


## Documentation

* [Perfect Schema Documentation](https://perfect-schema.github.io/perfect-schema/)
* Standard validators
  * [Allowed Values](https://perfect-schema.github.io/standard-validators/docs/allowed-values.html)
  * [Custom validation](https://perfect-schema.github.io/standard-validators/docs/custom.html)
  * [Match Pattern](https://perfect-schema.github.io/standard-validators/docs/match.html)
  * [Restricted Values](https://perfect-schema.github.io/standard-validators/docs/restricted-values.html)


## license

MIT

---
_Source: https://npm.io/package/@perfect-schema/standard-validators · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
