Commit 8eac6fa
Haider
stdin: address cubic P2 + P3 on commit 7fceb85
P2 (NPE guard incomplete): a caller that passes `deps.isTTY` bypasses
the outer `process.stdin?.isTTY` guard, and if `process.stdin` is
undefined the default reader crashes on `stdin.on(...)`. Add a defensive
check inside `defaultReadStdin` that returns "" when stdin is absent.
New regression test exercises the path with `deps.isTTY` set + undefined
`process.stdin` + no `readStdin` injection.
P3 (warning text misleading for non-timeout empty results): an empty
result can come from the timer firing, a clean `end` with zero bytes,
or an error event — the previous "no data received within Nms" wording
implied only the first. Reword to cause-neutral "stdin produced no
data" while keeping the env-var tip for slow-producer cases.1 parent 9cf83d9 commit 8eac6fa
2 files changed
Lines changed: 34 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
101 | 105 | | |
102 | | - | |
103 | | - | |
| 106 | + | |
| 107 | + | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| |||
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
135 | 144 | | |
136 | 145 | | |
137 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
141 | 163 | | |
142 | 164 | | |
143 | 165 | | |
| |||
150 | 172 | | |
151 | 173 | | |
152 | 174 | | |
153 | | - | |
| 175 | + | |
154 | 176 | | |
155 | 177 | | |
156 | 178 | | |
| |||
0 commit comments