Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jaywalk

blakeembrey42Apache-2.00.10.8TypeScript support: included

Runtime type validation

schema, json, validation, types, runtime, serialize

readme

Jaywalk

NPM version NPM downloads Build status Test coverage

Runtime type validations.

Installation

npm install jaywalk --save

Usage

import { Types, compile } from 'jaywalk'

const schema = new Types.Object({
  properties: {
    username: new Types.String({ minLength: 1, maxLength: 30, pattern: '^[A-Za-z0-9_]+$' })
  }
})

const validate = compile(schema)

validate({ username: 'hello' }).then(...)

License

Apache 2.0