()
| 12 | let originalStderrWrite: WritableMethod | null = null; |
| 13 | |
| 14 | function createSuppressedWrite(): WritableMethod { |
| 15 | return (_chunk: unknown, encoding?: unknown, callback?: unknown): boolean => { |
| 16 | const resolvedCallback = |
| 17 | typeof encoding === 'function' ? encoding : typeof callback === 'function' ? callback : null; |
| 18 | |
| 19 | if (typeof resolvedCallback === 'function') { |
| 20 | queueMicrotask(() => resolvedCallback(null)); |
| 21 | } |
| 22 | |
| 23 | return true; |
| 24 | }; |
| 25 | } |
| 26 | |
| 27 | function setWrite(target: StdioWriteTarget | undefined, write: WritableMethod): void { |
| 28 | if (!target || typeof target.write !== 'function') { |
no outgoing calls
no test coverage detected