0.9.10 • Published 4 years ago

typeguard-composer v0.9.10

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

typeguard-composer

CI codecov

Performant and composable type guards for runtime data validation.

import { validate } from 'typeguard-composer';
import { isString, isNumber } from 'typeguard-composer/validators';
import { AddressSchema } from './address.schema';

const PersonSchema = {
  name: isString,
  age: isNumber,
  addresses: [AddressSchema]
}

validate(PersonSchema, { name: 'Test Elek', age: 18, addresses: []});

Install

To install run npm i typeguard-composer.

Built in validators

This libary inculdes validators for the basic primitives only. You can (soon) use the typeguard-composer-validators package to match against various other types.

License

MIT Licensed

0.9.10

4 years ago

0.9.9

6 years ago

0.9.8

6 years ago

0.9.7

6 years ago

0.9.6

6 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago