From 6fe8e88d8ddc48f22ed540907b7049fbd9ef2251 Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Thu, 31 Oct 2019 09:45:34 +0700 Subject: [PATCH] updated version and name --- README.md | 4 ++-- package.json | 2 +- src/booler.js | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ff5ce41..c7dc20d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index fd4e173..9ace955 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "booler", + "name": "boolerjs", "version": "0.0.1", "description": "Convert string to Boolean in JavaScript.", "main": "index.js", diff --git a/src/booler.js b/src/booler.js index 2b03645..523aebd 100644 --- a/src/booler.js +++ b/src/booler.js @@ -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; }