0.1.1 • Published 9 years ago

@deecision/resolver v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

@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);