forked from sombochea/booler
add booler function and exports
This commit is contained in:
13
src/booler.js
Normal file
13
src/booler.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @author Samob Chea <sombochea@cubetiqs.com>
|
||||
*
|
||||
* Booler can convert any value to Boolean.
|
||||
*
|
||||
* @param {*} val Value to parse.
|
||||
*/
|
||||
const booler = (val) => {
|
||||
return val == 't' || val == 'true' || val == 1;
|
||||
}
|
||||
|
||||
// export module within function name `booler`.
|
||||
module.exports = booler;
|
||||
Reference in New Issue
Block a user