@availity/dockyard
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

@availity/dockyard

Convert yup schema to a friendly docs object

Version NPM Downloads Dependecy Status

Installation

NPM

npm install @availity/dockyard

Yarn

yarn add @availity/dockyard

Usage

import yup from 'yup';
import getRules from '@availity/dockyard';

const schema = yup.object({
  name: yup.string(),
  dateOfBirth: yup.date(),
});

const rules = getRules(schema, options);

options

const options = {
  compileRequiredFields: false,
  excludeOneOf: false,
  excludeTypes: false,
};
  • compileRequiredFields: removes the word 'required' from the description and adds an array of required fields to the object.
  • excludeOneOf: if oneOf is specified on an item, exclude it from the description.
  • excludeTypes: exclude types from the description.

Readme

Keywords

Package Sidebar

Install

npm i @availity/dockyard

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

24.2 kB

Total Files

13

Last publish

Collaborators

  • lauroxx
  • dznjudo
  • availity-cicd-bot
  • azeigler
  • dnoler
  • jselden
  • cbaker1
  • twarner
  • gregmartdotin
  • hnicbaker
  • chrishavekost
  • jordan-a-young