npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

io-ts-decode

1.1.0

@stevemao

npmHomeRepoSnykSocket
Downloads:170
$ npm install io-ts-decode
DailyWeeklyMonthlyYearly

Decode with error to reduce boilerplate

import ioTsDecode from 'io-ts-decode'
import * as t from 'io-ts'
import { pipe } from 'fp-ts/lib/pipeable'

const onLeft = (e: Error): string => String(e)

const onRight = (s: string) => `No errors: ${s}`

pipe(
    ioTsDecode(t.string, null),
    ... // compose with other `TaskEither`s
)