Installation
works both on front and back-end
Deep Waters is released under the MIT license & supports modern environments.
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;

UMD/AMD modules

The node package contains both an UMD and an AMD version of the module:
const DWumd = require('deep-waters/deep-waters.umd');
​
// or
​
const DWamd = require('deep-waters/deep-waters.amd');
​
Copy link