@gin93r/to-bool
v0.1.1
Published
Simple module to convert values to boolean values.
Readme
To Bool
A small library that converts typical "boolean" values to boolean
Installation
npm install @gin93r/to-bool
Usage
var toBool = require('@gin93r/to-bool');
var b = toBool(0, [options]}); // falseOptions
treatUndefinedAsFalse | default: true
treatNullAsFalse | default: true
When true, undefined and null values will be returned as false.
When false, undefined and null will be returned as normal.
var b = toBool(undefined, {treatUndefinedAsFalse:false}) // undefined
var b = toBool(null, {treatNullAsFalse:false}) // nullTests
npm test
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
