mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 16:02:32 +00:00
11 lines
324 B
TypeScript
11 lines
324 B
TypeScript
import type { Writable } from 'node:stream'
|
|
|
|
export function endSubprocessStdin(stdin: Writable | null | undefined, input: string): void {
|
|
if (!stdin) {
|
|
return
|
|
}
|
|
// Why: early exit or timeout can close a large write; the child callback owns the command result.
|
|
stdin.once('error', () => {})
|
|
stdin.end(input)
|
|
}
|