booleanify
v1.0.0
Published
Convert a value to a boolean - recognizes 'true' and 'false' strings
Downloads
1,103
Maintainers
Readme
booleanify
Convert a value to a boolean - recognizes
'true'
and'false'
strings
Install
$ npm install --save booleanify
Usage
var booleanify = require('booleanify');
booleanify('true');
//=> true
booleanify('false');
//=> false
booleanify(false);
//=> false
booleanify(0);
//=> false
booleanify('');
//=> false
booleanify(null);
//=> false
booleanify(123);
//=> true
booleanify('foobar');
//=> true
License
MIT © Arthur Verschaeve