yup-schema

1.0.0-alpha.2 • Public • Published

yup-schema

Developed by Flipbyte

This project was cloned from the Flipbyte project because that project was no longer being patched and maintained.

npm package license

yup-schema is a simple library that allows you to write yup rules using arrays.

Installation

npm i @flipbyte/yup-schema

Usage

The library considers each yup method to be an array within a main array, with method name as the first value, followed by the arguments (if any).

Example

yup.object().shape({
    name: yup.string().required(),
    age: yup.number().min(18)
})

would become

[['object'], ['shape', {
    name: [['string'], ['required']],
    age: [['number'], ['min', 18]]
}]]

License

The MIT License (MIT)

Package Sidebar

Install

npm i yup-schema

Weekly Downloads

29

Version

1.0.0-alpha.2

License

MIT

Unpacked Size

26.3 kB

Total Files

8

Last publish

Collaborators

  • harveyramer