mkbool

1.1.3 • Public • Published

mkbool

Convert any value to boolean

npm url

https://www.npmjs.com/package/mkbool

Getting started

  1. Install the package npm i mkbool or npm i mkbool@beta
  2. Require to your script var mkbool = require('mkbool');
  3. And use it var isBool = mkbool('any value or variable')

mkbool is able to check types of

  • Infinity number 5/0
  • NaN
  • Integer number
  • Floating number
  • Empty Array []
  • Array with item [1, 2, 0, ...]
  • Empty Object {}
  • Object with item {key: 'value'}
  • Empty string ''
  • String 'any string'
  • And more

Test

test.js is initialized with several values which will go through each value and return mkbool type. Run npm test to test. Change values on test.js to test your values.

Standard test will be added later.

Package Sidebar

Install

npm i mkbool

Weekly Downloads

2

Version

1.1.3

License

MIT

Unpacked Size

3.63 kB

Total Files

5

Last publish

Collaborators

  • m3alamin