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

Function takeUntil

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

Source from the content-addressed store, hash-verified

157 const write = yield* socket.writer
158
159 const takeUntil = (expected: string, seen = ""): Effect.Effect<string, unknown> =>
160 Effect.gen(function* () {
161 const next = seen + (yield* Queue.take(messages).pipe(Effect.timeout("5 seconds")))
162 if (next.includes(expected)) return next
163 return yield* takeUntil(expected, next)
164 })
165
166 yield* write("ping-v2\n")
167 expect(yield* takeUntil("ping-v2")).toContain("ping-v2")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected