flow-runtime-validators

0.17.0 • Public • Published

flow-runtime-validators

Common validators for use with flow-runtime.

See the docs at https://codemix.github.io/flow-runtime/#/flow-runtime-validators

Installation

npm install flow-runtime-validators

or

yarn add flow-runtime-validators

Usage

import t from 'flow-runtime';
import * as validators from 'flow-runtime-validators';

type EmailAddress = string;

EmailAddress.addConstraint(
  validators.length({max: 250}),
  validators.email()
);

EmailAddress.assert("foo@example.com"); // ok
EmailAddress.assert("nope.com"); // throws

Readme

Keywords

none

Package Sidebar

Install

npm i flow-runtime-validators

Weekly Downloads

430

Version

0.17.0

License

MIT

Unpacked Size

196 kB

Total Files

63

Last publish

Collaborators

  • gajus
  • charlespick
  • jedwards1211