2.2.1 • Published 3 years ago

valid9 v2.2.1

Weekly downloads
1
License
ISC
Repository
github
Last release
3 years ago

valid9, v2

An easier and clearer way to validate

Built for Vue, but works for any validation method that tests a condition and returns a string;

import { initiateRules } from 'valid9';

const ruleSet = {
  function isEqualTo(val, param1){
    const condition = val === param1;
    const msg = `${val} does not equal ${param1}`;
    
    return { condition, msg }
  }
}

const v9 = initiateRules(ruleSet);

In Vue template;

<q-input
  :rules=[v9.isEqualTo('someValue')]
/>

Valid9 comes with a set of default rules - you do not need to add your own.

import { initiateRules } from 'valid9';

const v9 = initiateRules();

Valid9 works with other libraries

import { initiateRules } from 'valid9';
import _ from 'lodash';

const ruleSet = {
  function isNumber(){
    const condition = _.isNumber(val);
    const message = `${val} is not a number`
  }
}

const v9 = initiateRules();
2.2.1

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago