Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antonioru/deep-waters
π₯Deep Waters is an easy-to-compose functional validation system for javascript developers π₯
https://github.com/antonioru/deep-waters
deep-waters functional functional-programming javascript nodejs validation validation-library validators
Last synced: 1 day ago
JSON representation
π₯Deep Waters is an easy-to-compose functional validation system for javascript developers π₯
- Host: GitHub
- URL: https://github.com/antonioru/deep-waters
- Owner: antonioru
- License: mit
- Created: 2020-04-25T14:46:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T04:26:32.000Z (about 2 years ago)
- Last Synced: 2025-01-03T02:19:33.923Z (9 days ago)
- Topics: deep-waters, functional, functional-programming, javascript, nodejs, validation, validation-library, validators
- Language: JavaScript
- Homepage: https://antonioru.gitbook.io/deep-waters/
- Size: 1.78 MB
- Stars: 200
- Watchers: 7
- Forks: 9
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- my-awesome-list - deep-waters - to-compose functional validation system for javascript developers π₯ | antonioru | 201 | (JavaScript)
- awesome-tiny-js - deep-waters - Composable functional validators, <img align="top" height="24" src="./img/deep-waterscompose-deep-watershasShape-deep-watersarrayOf-deep-watersisString-deep-watersisNumber-deep-watersisBoolean.svg">. (Validation / Reactive Programming)
- awesome-github-repos - antonioru/deep-waters - π₯Deep Waters is an easy-to-compose functional validation system for javascript developers π₯ (JavaScript)
README
[![Build Status](https://travis-ci.org/antonioru/deep-waters.svg?branch=master)](https://travis-ci.org/antonioru/deep-waters)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![npm](https://img.shields.io/npm/v/deep-waters)
![GitHub stars](https://img.shields.io/github/stars/antonioru/deep-waters?style=social)# Deep waters
![Usage example](./usage_example.png)
## π‘ 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.
π Documentation
## βοΈ 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:
```bash
npm install deep-waters
```Deep Waters exports its modules as CommonJS modules, so that each one can be easily imported individually,
as the following:```js
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.
```js
const DW = require('deep-waters');const arrayValidator = DW.compose(DW.minLength(3), DW.ofUniqueItems);
arrayValidator([1,2,3,4]); // => true;
```
π Documentation
## π° Licence
Deep Waters is released under the [MIT license](./LICENSE.md) & supports modern environments.
## π§βπ€βπ§ Contributing
Contributions are very welcome and wanted.
To submit your custom hook, please make sure your read our [CONTRIBUTING](./CONTRIBUTING.md) 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](./CHANGELOG.md) 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](https://www.flaticon.com/authors/freepik) from [www.freepik.com](http://www.freepik.com)