Convert string to Boolean in JavaScript.
Go to file
2020-04-17 20:27:05 +07:00
src fixed case sensitive 2019-10-31 09:51:04 +07:00
test fixed case sensitive 2019-10-31 09:51:04 +07:00
.drone.yml update drone 2020-04-17 20:27:05 +07:00
.gitignore Initial commit 2019-10-31 08:14:38 +07:00
index.js updated information and hnage booler.js to booler 2019-10-31 09:40:11 +07:00
LICENSE Initial commit 2019-10-31 08:14:38 +07:00
package.json updated to 0.0.3 2019-12-06 12:41:25 +07:00
README.md Update 'README.md' 2020-04-17 20:16:22 +07:00

Booler: Convert any values to Boolean.

Build Status

Convert string/values to Boolean in JavaScript.

Installing

$ npm i boolerjs --save

Example

const assert = require('assert');
const booler = require('boolerjs')

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'));
})

it(`booler will be pass it to equal 't'`, () => {
    assert.equal(true, booler('t'));
})

it(`booler will be pass it to equal '1'`, () => {
    assert.equal(true, booler('1'));
})

it('booler will be pass it to equal 1', () => {
    assert.equal(true, booler(1));
})

it('booler will be pass it to equal false', () => {
    assert.equal(false, booler(false));
})

it(`booler will be pass it to equal 'false'`, () => {
    assert.equal(false, booler('false'));
})

it(`booler will be pass it to equal 'f'`, () => {
    assert.equal(false, booler('f'));
})

it(`booler will be pass it to equal '0'`, () => {
    assert.equal(false, booler(0));
})

it('booler will be pass it to equal 0', () => {
    assert.equal(false, booler(0));
})

Run Test

$ npm run test

Contribution

if you any ideas or concepts, please kindly provide and support with us.

Author

Name: Sambo Chea
Email: sombochea@cubetiqs.com