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

Function collectValues

common/src/util/__tests__/error-abort.test.ts:469–478  ·  view source on GitHub ↗
(signal: { aborted: boolean })

Source from the content-addressed store, hash-verified

467 }
468
469 async function collectValues(signal: { aborted: boolean }): Promise<{ values: number[]; abortedAt?: string }> {
470 const values: number[] = []
471 for await (const result of generateValues(signal)) {
472 if (result.aborted) {
473 return { values, abortedAt: result.reason }
474 }
475 values.push(result.value)
476 }
477 return { values }
478 }
479
480 it('collects all values when not aborted', async () => {
481 const signal = { aborted: false }

Callers 1

Calls 1

generateValuesFunction · 0.85

Tested by

no test coverage detected