Refactor streaming to simplify for logging change (#28056)
This commit is contained in:
parent
4949b6da58
commit
a4de0e364b
3 changed files with 139 additions and 92 deletions
22
streaming/utils.js
Normal file
22
streaming/utils.js
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue