1.1.1 • Published 3 years ago

nibzvln v1.1.1

Weekly downloads
13
License
MIT
Repository
github
Last release
3 years ago

Welcome to nibzvln 👋

Version License: MIT

JavaScript reusable chainable validation library

Install

yarn add nibzvln

or

npm install nibzvln

Usage

Chainable

nibzvln().numeric().minLength(3).validate("123"); // true

nibzvln().not().numeric().minLength(3).validate("hello"); // true

nibzvln().numeric().minLength(3).validate("hello"); // false

nibzvln().minLength(3).not().email().validate("hello"); // true

nibzvln().not().minLength(45).email().validate("example@example.com"); // true

Extendable

You can create your own custom validation rules

const customRules = {
    foo: () => (text) => text === "bar";
}

nibzvln.defineCustomRules(customRules);

And you can use them like built-in ones

nibzvln().minLength(3).foo().validate("bar"); // true

You can also remove custom validation rules that are created

nibzvln.clearCustomRules();

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago