mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 12:58:06 +01:00
22 lines
266 B
JavaScript
22 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;
|