(effect: Effect.Effect<A, E, R>)
| 12 | }) |
| 13 | |
| 14 | const withRestoredIsTTY = <A, E, R>(effect: Effect.Effect<A, E, R>) => |
| 15 | Effect.acquireUseRelease( |
| 16 | Effect.sync(() => streams.map((stream) => Object.getOwnPropertyDescriptor(stream, "isTTY"))), |
| 17 | () => effect, |
| 18 | (descriptors) => |
| 19 | Effect.sync(() => { |
| 20 | streams.forEach((stream, index) => { |
| 21 | const descriptor = descriptors[index] |
| 22 | if (descriptor === undefined) { |
| 23 | Reflect.deleteProperty(stream, "isTTY") |
| 24 | } else { |
| 25 | Object.defineProperty(stream, "isTTY", descriptor) |
| 26 | } |
| 27 | }) |
| 28 | }) |
| 29 | ) |
| 30 | |
| 31 | describe("NodeStdio", () => { |
| 32 | it.effect("reads terminal state when the effects run", () => |
no test coverage detected