0.9.10 • Published 5 years ago

typeguard-composer v0.9.10

Weekly downloads
3
License
MIT
Repository
github
Last release
5 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

5 years ago

0.9.9

8 years ago

0.9.8

8 years ago

0.9.7

8 years ago

0.9.6

8 years ago

0.9.4

8 years ago

0.9.3

8 years ago

0.9.2

8 years ago

0.9.1

8 years ago

0.9.0

8 years ago