Use undefined instead of null

This commit is contained in:
RMidhunSuresh 2021-11-11 16:25:14 +05:30
parent eb7c5c4437
commit 9fed2ca41b

View file

@ -30,7 +30,7 @@ export enum LogLevel {
export type LogLevelOrNull = LogLevel | null;
export class LogFilter {
private _min: LogLevelOrNull = null;
private _min?: LogLevel;
private _parentFilter?: LogFilter;
constructor(parentFilter?: LogFilter) {
@ -44,7 +44,7 @@ export class LogFilter {
}
}
// neither our children or us have a loglevel high enough, filter out.
if (this._min !== null && !Array.isArray(children) && item.logLevel < this._min) {
if (this._min && !Array.isArray(children) && item.logLevel < this._min) {
return false;
} else {
return true;