Skip to content

๐Ÿ”ฅDeep Waters is an easy-to-compose functional validation system for javascript developers ๐Ÿ”ฅ

License

Notifications You must be signed in to change notification settings

antonioru/deep-waters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Build Status License: MIT npm GitHub stars

Deep waters

deep-waters

An easy-to-compose functional validation system for javascript developers

Usage example

๐Ÿ’ก What is Deep Waters?

An easy-to-compose functional validation system for javascript developers

It allows to easily create custom and reusable validators from the pre-existing ones by using a functional approach and the composition principle.

โ˜•๏ธ Features

  • Full functional
  • Strict types validation based on Object.prototype.toString instead of typeof to avoid unexpected behaviours
  • Tiny and lightweight
  • Extremely modular
  • Concise API

๐Ÿ•บ Installation

You can install it by using NPM:

npm install deep-waters

Deep Waters exports its modules as CommonJS modules, so that each one can be easily imported individually, as the following:

const compose = require('deep-waters/compose');
const minLength = require('deep-waters/minLength');
const ofUniqueItems = require('deep-waters/ofUniqueItems'); 

const arrayValidator = compose(minLength(3), ofUniqueItems);  

arrayValidator([1,2,3,4]); // => true;

Alternatively, it's possible to import all the modules at once with the same result.

const DW = require('deep-waters');

const arrayValidator = DW.compose(DW.minLength(3), DW.ofUniqueItems);  

arrayValidator([1,2,3,4]); // => true;

๐Ÿ”ฐ Licence

Deep Waters is released under the MIT license & supports modern environments.

๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Contributing

Contributions are very welcome and wanted.

To submit your custom hook, please make sure your read our CONTRIBUTING guidelines.

Before submitting a new merge request, please make sure:

  1. You have updated the package.json version and reported your changes into the CHANGELOG file
  2. make sure you run npm test before submitting your merge request.
  3. In case you're creating a new validator please make sure it is well documented and tested

Icon made by Freepik from www.freepik.com

About

๐Ÿ”ฅDeep Waters is an easy-to-compose functional validation system for javascript developers ๐Ÿ”ฅ

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published