2
0

Refactor streaming to simplify for logging change (#28056)

This commit is contained in:
Emelia Smith
2023-11-28 15:24:41 +01:00
committed by GitHub
parent 4949b6da58
commit a4de0e364b
3 changed files with 139 additions and 92 deletions

22
streaming/utils.js Normal file
View File

@@ -0,0 +1,22 @@
// @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;