@deecision/resolver
v0.1.1
Published
Data validation + normalization made easy
Downloads
3
Readme
@deecision/resolver
Validate and normalize your data with ease.
- Full tested with jest (100% coverage).
- Rigorously typed with flow.
- Fully and easily extensible.
- Readable and maintainable codebase, no dependency.
Get started
How to install:
- using npm:
npm install --save @deecision/resolver
- using yarn:
yarn add @deecision/resolver
How to use:
import Resolver from '@deecision/resolver';
const resolver = Resolver.create('object', { props: {
email: { type: 'string', required: true, pattern: 'email' },
password: { type: 'string', required: true, length: [ 8, Infinity ] },
remember: { type: 'boolean' },
}});
// returns normalized data
// throws violations if validation fails
const data = resolver.resolve(data);