MCPcopy Index your code
hub / github.com/anomalyco/opencode / takeUntil

Function takeUntil

packages/opencode/test/server/httpapi-pty.test.ts:281–286  ·  view source on GitHub ↗
(expected: string, seen = "")

Source from the content-addressed store, hash-verified

279 const write = yield* socket.writer
280
281 const takeUntil = (expected: string, seen = ""): Effect.Effect<string, unknown> =>
282 Effect.gen(function* () {
283 const next = seen + (yield* Queue.take(messages).pipe(Effect.timeout("5 seconds")))
284 if (next.includes(expected)) return next
285 return yield* takeUntil(expected, next)
286 })
287
288 yield* write("ping-route\n")
289 expect(yield* takeUntil("ping-route")).toContain("ping-route")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected