# ts-api-validator

> This is library for validate data from server or other API.

Latest version **3.0.1** (published 2019-09-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install ts-api-validator
pnpm add ts-api-validator
yarn add ts-api-validator
bun add ts-api-validator
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2019-09-18 |
| First published | 2017-08-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 46.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniil |
| Maintainers | tsigel |

## Links

- npm: https://www.npmjs.com/package/ts-api-validator
- Repository: https://github.com/tsigel/ts-api-validator
- Homepage: https://github.com/tsigel/ts-api-validator#readme
- Issues: https://github.com/tsigel/ts-api-validator/issues
- npm.io page: https://npm.io/package/ts-api-validator

## Recent versions

- 3.0.1 (latest) — 2019-09-18
- 3.0.0 — 2019-09-18
- 2.1.3 — 2018-06-21
- 2.1.2 — 2018-04-16
- 2.1.1 — 2018-03-23
- 2.1.0 — 2018-03-06
- 2.0.0 — 2017-09-29
- 1.1.1 — 2017-09-25
- 1.1.0 — 2017-09-25
- 1.0.1 — 2017-09-25
- 1.0.0 — 2017-09-21
- 0.0.8 — 2017-09-18
- 0.0.7 — 2017-09-15
- 0.0.6 — 2017-09-05
- 0.0.5 — 2017-09-04
- … 2 more at https://npm.io/package/ts-api-validator/versions

## README

# ts-api-validator

This is library for validate data from server or other API.

Example:
```typescript
import { Schema, ObjectPart, StringPart, ArrayPart } from 'ts-api-validator';

const schema = new Schema({
  type: ArrayPart,
  required: true,
  content: {
    type: ObjectPart,
    required: true,
    content: {
       someField: { type: StringPart, required: true }
    }
  }
}); // This is schema for parse inteface like Array<{ someField: string }>;

schema.parse([{someField: 'some text'}]);
```

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