add booler function and exports

This commit is contained in:
2019-10-31 09:03:22 +07:00
parent bc3180637f
commit 09239c704c
5 changed files with 874 additions and 0 deletions

13
src/booler.js Normal file
View 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;