Json (Yup)

Json (Yup)

Encodes and decodes messages using simple JSON validated with Yup.

Installation

npm install yup

Usage

import yup from 'yup'
import { yupJsonEncoder } from '@adaloop/tellthem/encoders/yup'
const encoder = yupJsonEncoder({
schema: yup.object({
test: yup.string()
})
})

Options

OptionDescription
schemaSchema used to validate your data.

On this page