13.0.0 • Published 2 years ago

is-positive-boolean v13.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

is-positive-boolean

Validate if a value is a positive boolean. Version 3 comes with some funky new features:

npm version

  • 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.
13.0.0

2 years ago

12.11.2

2 years ago

12.11.1

2 years ago

12.11.0

2 years ago