MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getFirstEvent

Method getFirstEvent

sdk/e2e/utils/event-collector.ts:55–61  ·  view source on GitHub ↗

Get the first event of a specific type

(
    type: T,
  )

Source from the content-addressed store, hash-verified

53
54 /** Get the first event of a specific type */
55 getFirstEvent<T extends PrintModeEvent['type']>(
56 type: T,
57 ): Extract<PrintModeEvent, { type: T }> | undefined {
58 return this.events.find(
59 (e): e is Extract<PrintModeEvent, { type: T }> => e.type === type,
60 )
61 }
62
63 /** Get the last event of a specific type */
64 getLastEvent<T extends PrintModeEvent['type']>(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected