is-positive-boolean
Validate if a value is a positive boolean. Version 3 comes with some funky new features:
- Lodash support. Because it isn't an NPM module without a lodash dependency... Right?
- Funky new styled error message (see below)
- Optional translation using google translate (Returns a promise if used. Dive source to find out how)
- Completely rebuilt in Typescript, which is minified for readability.
Funky New Styled Error Message
- First we split the string into characters and call map on the resulting array passing a function that does the following:
- The function picks 3 random (and unique) methods from the colors module, using the excellent pick-some module.
- Then we use colors's signature super nifty way, which extends string.prototype to call the first function picked on each character
Install
npm install --save is-positive-boolean
Usage
var isPositiveBoolean = require('is-positive-boolean');
// Test cases
// Valid positive values
isPositiveBoolean(true); // true
//Valid negative values
isPositiveBoolean(false); // false
## License
MIT © Tom Cumpsty.