A database of types, combinators and functions built with and for tcomb (work in progress)
Work in progress
Run mocha
in the project root.
Used regexps from: https://github.com/chriso/validator.js
If you do have a contribution for the package feel free to put up a Pull Request or open an Issue.
var Password = minLength(8);
var Zip = maxLength(4);
var Celsius = min(−273.15);
var Positive = minExcluded(0);
var Minute = max(60);
var Negative = maxExcluded(0);
var Numeric = regexp(/^-?[0-9]+$/);
var Percentage = between({min: 0, max: 100});
either(A, B, [name])
var T = either(Str, Num, 'T');
var t = T({left: 'a', right: null}); // => $T{left: 'a', right: null}
t.isLeft(); // => true
- Alpha
- Alphanumeric
- Numeric
- UUID3
- UUID4
- UUID5
- UUID
- Int
- Positive
- PositiveInt
- Negative
- NegativeInt
- Percentage