MCPcopy Create free account
hub / github.com/Noumena-Network/code / parseCounter

Function parseCounter

src/ink/replPerfHarness.tsx:276–285  ·  view source on GitHub ↗
(
  output: string,
)

Source from the content-addressed store, hash-verified

274}
275
276export function parseCounter(
277 output: string,
278): { current: number; total: number } | null {
279 const match = stripTerminalOutput(output).match(/\b(\d+)\/(\d+)\b/)
280 if (!match) return null
281 return {
282 current: Number.parseInt(match[1]!, 10),
283 total: Number.parseInt(match[2]!, 10),
284 }
285}
286
287export function readInkScreenCounter(ink: MountedInkProbe | undefined) {
288 if (!ink) return null

Callers 1

readInkScreenCounterFunction · 0.85

Calls 1

stripTerminalOutputFunction · 0.85

Tested by

no test coverage detected