From fde0163b978dcc1d9dfc969ad3547c8212514a23 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 17 Nov 2021 13:53:27 +0100 Subject: [PATCH] remove unneeded union type and simplify code --- src/logging/LogItem.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/logging/LogItem.ts b/src/logging/LogItem.ts index 4fb8daa0..f9262db7 100644 --- a/src/logging/LogItem.ts +++ b/src/logging/LogItem.ts @@ -187,9 +187,8 @@ export class LogItem implements ILogItem { if (this.end) { console.trace("log item is finished, additional logs will likely not be recorded"); } - let result: T | Promise; try { - result = callback(this); + const result = callback(this); if (result instanceof Promise) { return result.then(promiseResult => { this.finish();