From cd7dccd804852ed38285e7786dc8bc9a5ab6a332 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 10 Nov 2021 19:13:35 +0530 Subject: [PATCH] Move interface to top --- src/logging/LogItem.ts | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/logging/LogItem.ts b/src/logging/LogItem.ts index f58a0185..b0412b02 100644 --- a/src/logging/LogItem.ts +++ b/src/logging/LogItem.ts @@ -38,6 +38,20 @@ type LogItemRef = { type LogItemValues = LogItemWithLabel | LogItemNetwork | LogItemRef; +interface ISerializedItem { + s: number; + d: number | null; + v: LogItemValues; + l: LogLevel; + e?: { + stack?: string; + name: string; + message: string; + }; + f?: boolean; + c?: Array; +}; + export type LabelOrValues = string | LogItemValues; export type FilterCreator = ((filter: LogFilter, item: LogItem) => LogFilter) | null; export type LogCallback = (item: LogItem) => unknown; @@ -150,22 +164,9 @@ export class LogItem { console.error("Error creating log filter", err); } } - interface Item { - s: number; - d: number | null; - v: LogItemValues; - l: LogLevel; - e?: { - stack: string | undefined; - name: string; - message: string; - }; - f?: boolean; - c?: Array; - }; - let children: Array | null = null; + let children: Array | null = null; if (this._children !== null) { - children = this._children.reduce((array: Array, c) => { + children = this._children.reduce((array: Array, c) => { const s = c.serialize(filter, this.start, false); if (s) { if (array === null) { @@ -180,7 +181,7 @@ export class LogItem { return null; } // in (v)alues, (l)abel and (t)ype are also reserved. - const item: Item = { + const item: ISerializedItem = { // (s)tart s: parentStartTime === null ? this.start : this.start - parentStartTime, // (d)uration