Coder Social home page Coder Social logo

olyno / deep-waters Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antonioru/deep-waters

0.0 0.0 0.0 1.85 MB

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

Home Page: https://antonioru.gitbook.io/deep-waters/

License: MIT License

JavaScript 100.00%

deep-waters's Introduction

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

deep-waters's People

Contributors

antonioru avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.