mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
23 lines
266 B
JavaScript
23 lines
266 B
JavaScript
|
// @ts-check
|
||
|
|
||
|
const FALSE_VALUES = [
|
||
|
false,
|
||
|
0,
|
||
|
'0',
|
||
|
'f',
|
||
|
'F',
|
||
|
'false',
|
||
|
'FALSE',
|
||
|
'off',
|
||
|
'OFF',
|
||
|
];
|
||
|
|
||
|
/**
|
||
|
* @param {any} value
|
||
|
* @returns {boolean}
|
||
|
*/
|
||
|
const isTruthy = value =>
|
||
|
value && !FALSE_VALUES.includes(value);
|
||
|
|
||
|
exports.isTruthy = isTruthy;
|