JSPM

  • Created
  • Published
  • Downloads 430650
  • Score
    100M100P100Q170733F
  • License MIT

A collection of codecs and combinators for use with io-ts

Package Exports

  • io-ts-types
  • io-ts-types/es6/BooleanFromString
  • io-ts-types/es6/DateFromISOString
  • io-ts-types/es6/DateFromNumber
  • io-ts-types/es6/DateFromUnixTime
  • io-ts-types/es6/IntFromString
  • io-ts-types/es6/NonEmptyString
  • io-ts-types/es6/NumberFromString
  • io-ts-types/es6/UUID
  • io-ts-types/es6/clone
  • io-ts-types/es6/date
  • io-ts-types/es6/either
  • io-ts-types/es6/fromNewtype
  • io-ts-types/es6/fromNullable
  • io-ts-types/es6/fromRefinement
  • io-ts-types/es6/getLenses
  • io-ts-types/es6/mapOutput
  • io-ts-types/es6/nonEmptyArray
  • io-ts-types/es6/option
  • io-ts-types/es6/optionFromNullable
  • io-ts-types/es6/regexp
  • io-ts-types/es6/setFromArray
  • io-ts-types/es6/withFallback
  • io-ts-types/es6/withMessage
  • io-ts-types/es6/withValidate
  • io-ts-types/lib/BooleanFromString
  • io-ts-types/lib/DateFromISOString
  • io-ts-types/lib/DateFromNumber
  • io-ts-types/lib/DateFromUnixTime
  • io-ts-types/lib/IntFromString
  • io-ts-types/lib/NonEmptyString
  • io-ts-types/lib/NumberFromString
  • io-ts-types/lib/UUID
  • io-ts-types/lib/clone
  • io-ts-types/lib/date
  • io-ts-types/lib/either
  • io-ts-types/lib/fromNewtype
  • io-ts-types/lib/fromNullable
  • io-ts-types/lib/fromRefinement
  • io-ts-types/lib/getLenses
  • io-ts-types/lib/mapOutput
  • io-ts-types/lib/nonEmptyArray
  • io-ts-types/lib/option
  • io-ts-types/lib/optionFromNullable
  • io-ts-types/lib/regexp
  • io-ts-types/lib/setFromArray
  • io-ts-types/lib/withFallback
  • io-ts-types/lib/withMessage
  • io-ts-types/lib/withValidate

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (io-ts-types) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

A collection of runtime types and combinators for use with io-ts

Installation

To install the stable version:

npm i io-ts-types

Note. io-ts-types depends on

starting from 0.5.0 you must install fp-ts, io-ts and monocle-ts manually (fp-ts, io-ts and monocle-ts are listed in peerDependency)

Usage

Import specific codecs and combinators directly from the lib folder, as in:

import { NonEmptyString } from "io-ts-types/lib/NonEmptyString"

In this way, you'll only need to add the monocle-ts dependency if you import any of the combinators depending on it, like getLenses

TypeScript compatibility

The stable version is tested against TypeScript 3.2.2, but should run with TypeScript 3.0.1+ too

Note. If you are running < typescript@3.0.1 you have to polyfill unknown.

You can use unknown-ts as a polyfill.

Documentation