ts-api-validator
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

ts-api-validator

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

Example:

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'}]);

Readme

Keywords

none

Package Sidebar

Install

npm i ts-api-validator

Weekly Downloads

320

Version

3.0.1

License

ISC

Unpacked Size

47.3 kB

Total Files

55

Last publish

Collaborators

  • tsigel