0.0.3 • Published 6 years ago

validate-switch v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Validate-switchBuild Status codecov

Global verification switch

ChineseƜEnglish

As a command line - the most important and only validation from the userUncertain input

Once we determine that the value given by the user iscorrect

Well, located in a large cli, underneathFunction functionYou can be sure that the parameters given to them are correct

Let's filter out the function-validation section, so sooner sooner?

Why ????

Because we can already control 吖


Ideas

Function function is divided into two operations

  1. As a base for cliNo need to verify data

  2. Self function - verification projectNeed to verify the data

Say it, that is relatedverify the data- Operation is filtered out, so oneswitch, born

Simple adoptionValidate-switch

if(getValidate().state){ // default: true
  // includes📦
  // validate data etc ...
}

Validate-switchIs nothing to do, just global val return

The most important thing is that you, who control the change of data, regardless of the success or failure of the process, should be controllable.

I think this is the idea that this project wants to transmit


Install

npm install validate-switch

yarn add validate-switch

Usage

const validateSwitch = require('validate-switch');

Api

1. superstruct

FromHttps://github.com/ianstormtaylor/superstruct

A simple and combinable way to validate data in javascript.

2. setvalidate(input)

Input

Type:Boolean

3. getvalidate : return {state}

State

Type:Boolean

4. togglevalidate : return {state}

State

Type:Boolean


License

Mit ©Chinanf-boy

0.0.3

6 years ago

0.0.2

7 years ago

0.0.1

7 years ago