1 | ;
|
2 |
|
3 | /**
|
4 | * Checks whether a value is truthy
|
5 | *
|
6 | * @function truthy
|
7 | *
|
8 | * @example
|
9 | * var is = require('predicates');
|
10 | *
|
11 | * is.truthy(true); // true
|
12 | * is.truthy(1); // true
|
13 | * is.truthy(0); // false
|
14 | *
|
15 | * @param {*} value
|
16 | * @returns {Boolean}
|
17 | */
|
18 | module.exports = function isTruthy(value) {
|
19 | return !!value;
|
20 | };
|