This commit is contained in:
Jaco Greeff
2021-03-07 16:02:32 +01:00
committed by GitHub
parent f259de2679
commit 003dc8d247
17 changed files with 87 additions and 70 deletions
+9 -3
View File
@@ -77,11 +77,17 @@ function noop (): void {
}
function parseEnv (type: string): [boolean, number] {
const maxSize = parseInt((typeof process === 'object' ? process : {})?.env?.DEBUG_MAX || '-1', 10);
const env = (typeof process === 'object' ? process : {}).env || {};
const maxSize = parseInt(env.DEBUG_MAX || '-1', 10);
return [
((typeof process === 'object' ? process : {})?.env?.DEBUG || '').toLowerCase().split(',').some((e) => !!e && (e === '*' || type.startsWith(e))),
isNaN(maxSize) ? -1 : maxSize
(env.DEBUG || '')
.toLowerCase()
.split(',')
.some((e) => !!e && (e === '*' || type.startsWith(e))),
isNaN(maxSize)
? -1
: maxSize
];
}