@mgfx/validator-iots
TypeScript icon, indicating that this package has built-in type declarations

0.2.12 • Public • Published

@mgfx/validator-iots

A validation library for mgFx that allows the use of io-ts decoders to validate Task input and output.

Usage

  1. Install @mgfx/validator-iots into your existing mgFx application:
$ yarn add @mgfx/validator-iots
  1. Use the ioTs function to use an io-ts decoder as a Validator in your Task definitions:
import { ioTs, t } from '@mgfx/validator-iots';
import { define } from 'mgfx';

const myTask = define({
  name: 'myTask',
  input: ioTs(t.string),
  output: ioTs(t.array(t.number))
});

Readme

Keywords

none

Package Sidebar

Install

npm i @mgfx/validator-iots

Weekly Downloads

2

Version

0.2.12

License

ISC

Unpacked Size

8.92 kB

Total Files

10

Last publish

Collaborators

  • nateabele
  • warrenseymour