Socket
Book a DemoInstallSign in
Socket

flow-runtime-validators

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-runtime-validators

A collection of common validators for flow-runtime.

latest
Source
npmnpm
Version
0.17.0
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 08 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts