Extra check for process for browser bundles (#923)

This commit is contained in:
Yuri
2021-03-07 12:05:54 +01:00
committed by GitHub
parent 4fbdbcf8c5
commit b0f783f54b
+2 -2
View File
@@ -77,10 +77,10 @@ function noop (): void {
}
function parseEnv (type: string): [boolean, number] {
const maxSize = parseInt(process?.env?.DEBUG_MAX || '-1', 10);
const maxSize = parseInt((typeof process === 'object' ? process : {})?.env?.DEBUG_MAX || '-1', 10);
return [
(process?.env?.DEBUG || '').toLowerCase().split(',').some((e) => !!e && (e === '*' || type.startsWith(e))),
((typeof process === 'object' ? process : {})?.env?.DEBUG || '').toLowerCase().split(',').some((e) => !!e && (e === '*' || type.startsWith(e))),
isNaN(maxSize) ? -1 : maxSize
];
}