# eclesi-schema-assert

> Extensible and easy to use input validation library

Latest version **0.0.21** (published 2022-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install eclesi-schema-assert
pnpm add eclesi-schema-assert
yarn add eclesi-schema-assert
bun add eclesi-schema-assert
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.21 |
| Published | 2022-09-23 |
| First published | 2022-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 25.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alef Castelo |
| Maintainers | alefcastelo |
| Keywords | node, browser, schema, input, validation, validator |

## Links

- npm: https://www.npmjs.com/package/eclesi-schema-assert
- Repository: https://github.com/alefcastelo/eclesi-assert
- Homepage: https://github.com/alefcastelo/eclesi-assert#readme
- Issues: https://github.com/alefcastelo/eclesi-assert/issues
- npm.io page: https://npm.io/package/eclesi-schema-assert

## Dependencies (2)

- [radash](https://npm.io/package/radash.md) ^7.1.0
- [libphonenumber-js](https://npm.io/package/libphonenumber-js.md) ^1.10.13

## Alternatives

- [@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
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 0.0.21 (latest) — 2022-09-23
- 0.0.20 — 2022-09-22
- 0.0.19 — 2022-09-22
- 0.0.18 — 2022-09-22
- 0.0.17 — 2022-09-22
- 0.0.16 — 2022-09-22
- 0.0.15 — 2022-09-22
- 0.0.14 — 2022-09-22
- 0.0.13 — 2022-09-22
- 0.0.12 — 2022-09-22
- 0.0.11 — 2022-09-22
- 0.0.10 — 2022-09-22
- 0.0.9 — 2022-09-22
- 0.0.8 — 2022-09-22
- 0.0.7 — 2022-09-22
- … 6 more at https://npm.io/package/eclesi-schema-assert/versions

## README

# Eclesi Schema Assert

This library provide an easy and extensible api to create schema validator for input or single values.

```typescript
const schema = Assert.strict({
  name: Assert.required().string(),
  email: Assert.required().email(),
  password: Assert.required().string().lengthMinimum(8)
})

// For a valid input the schema validation will return undefined because no violations was found
schema.validate({
  name: 'Alef',
  email: 'any@email.com',
  password: 's3cr3tp4ssw0rd'
})

// For a invalid input the schema validation will return an object containing each violation for each property
schema.validate({})
/**
 * {
 *    schema: ['strict_type_mismatch'],
 *    name: ['required', 'string_type_mismatch'],
 *    email: ['required', 'email_type_mismatch'],
 *    password: ['required', 'string_type_mismatch', 'length_out_of_minimum']
 *  }
 */
```

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