mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-03 07:54:40 +08:00
process.stdin/stdout/stderr.fd answers Node's compile-time descriptor (0/1/2, on a TTY, a pipe, and a redirected file alike), and process.stdin.isRaw answers the TTY's raw-mode flag through scr_process_stdin_is_raw (1/0), or Node's undefined on a pipe-backed stdin through the module's interned `boolean | undefined` union. The declared type of isRaw is `boolean` (as @types/node has it), so the read is added to isOptionalProcessStreamProperty: without that entry maybeNarrow bridges the union to the declared arm and the runtime guard traps on the undefined a pipe actually answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>