remove unneeded union type and simplify code

This commit is contained in:
Bruno Windels 2021-11-17 13:53:27 +01:00
parent 42e5fb33ba
commit fde0163b97

View file

@ -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<T>;
try {
result = callback(this);
const result = callback(this);
if (result instanceof Promise) {
return result.then(promiseResult => {
this.finish();