Skip to content

ScopeTracker

Defined in: packages/app-report/src/util/scope-tracker.ts:46

Reconstructs the scope tree from a stream of ReportEvents.

Shared by every sink that needs the tree (indentation, dotted paths, JUnit nesting, GitHub group nesting, duration roll-ups) so each one doesn’t re-derive it from the raw event stream independently.

new ScopeTracker(): ScopeTracker

ScopeTracker

all(): readonly ScopeRecord[]

Defined in: packages/app-report/src/util/scope-tracker.ts:140

Every scope observed so far, in scope-start order.

readonly ScopeRecord[]


children(id): readonly ScopeRecord[]

Defined in: packages/app-report/src/util/scope-tracker.ts:145

Direct children of id, in the order their scope-start was observed.

string | null

readonly ScopeRecord[]


depth(id): number

Defined in: packages/app-report/src/util/scope-tracker.ts:180

Depth of id below the root scopes (a root scope has depth 0).

string

number


get(id): ScopeRecord | undefined

Defined in: packages/app-report/src/util/scope-tracker.ts:135

The scope record for id, or undefined if no scope-start declared it.

string

ScopeRecord | undefined


observe(event): void

Defined in: packages/app-report/src/util/scope-tracker.ts:51

Feed one event into the tracker, updating its internal state.

ReportEvent<unknown>

void


open(): readonly ScopeRecord[]

Defined in: packages/app-report/src/util/scope-tracker.ts:156

Scopes with no scope-end observed yet.

readonly ScopeRecord[]


path(id): readonly ScopeRecord[]

Defined in: packages/app-report/src/util/scope-tracker.ts:163

The chain from the root to id, inclusive, root first.

string

readonly ScopeRecord[]


roots(): readonly ScopeRecord[]

Defined in: packages/app-report/src/util/scope-tracker.ts:151

Top-level scopes (parentId === null).

readonly ScopeRecord[]