Document the Node stream-pair typing gap

This commit is contained in:
m4air
2026-09-28 04:58:45 -07:00
parent 362ba8c2f2
commit 7f0dfbb8b8
+3 -1
View File
@@ -10,7 +10,9 @@ export function openWslDaemonConnectorStream(
): Promise<Duplex> {
signal.throwIfAborted()
const child = spawnProcess(spec)
const stream = Duplex.from({ readable: child.stdout, writable: child.stdin })
const pair = { readable: child.stdout, writable: child.stdin }
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Node supports Node-stream pairs; current typings omit them. Byte/EOF tests cover this path.
const stream = Duplex.from(pair as unknown as Parameters<typeof Duplex.from>[0])
// A child can fail before the awaiting protocol consumer has installed its listener.
stream.on('error', () => {})
stream.once('close', () => child.kill())