updated version and name

This commit is contained in:
Sambo Chea 2019-10-31 09:45:34 +07:00
parent 7c8e9d81be
commit 6fe8e88d8d
3 changed files with 5 additions and 3 deletions

View File

@ -5,13 +5,13 @@ Convert string/values to Boolean in JavaScript.
## Installing
```shell
$ npm i booler --save
$ npm i boolerjs --save
```
## Example
```js
const booler = require('booler')
const booler = require('boolerjs')
console.log(booler('f')) // return false
console.log(booler('t')) // return true

View File

@ -1,5 +1,5 @@
{
"name": "booler",
"name": "boolerjs",
"version": "0.0.1",
"description": "Convert string to Boolean in JavaScript.",
"main": "index.js",

View File

@ -6,6 +6,8 @@
* @param {*} val Value to parse.
*/
const booler = (val) => {
// transform to string lower case.
val = val + "".toLowerCase();
return val == 't' || val == 'true' || val == 1;
}