forked from sombochea/booler
fixed case sensitive
This commit is contained in:
parent
6fe8e88d8d
commit
e855852ccc
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "boolerjs",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"description": "Convert string to Boolean in JavaScript.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
const booler = (val) => {
|
||||
// transform to string lower case.
|
||||
val = val + "".toLowerCase();
|
||||
val = (val + "").toLowerCase();
|
||||
return val == 't' || val == 'true' || val == 1;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,10 @@ it('booler will be pass it to equal true', () => {
|
||||
assert.equal(true, booler(true));
|
||||
})
|
||||
|
||||
it('booler will be pass it to equal True', () => {
|
||||
assert.equal(true, booler('True'));
|
||||
})
|
||||
|
||||
it(`booler will be pass it to equal 'true'`, () => {
|
||||
assert.equal(true, booler('true'));
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user