(target, prop, receiver)
| 757 | function wrapReadTextWithError(inner: Kaos, cause: Error): Kaos { |
| 758 | return new Proxy(inner, { |
| 759 | get(target, prop, receiver) { |
| 760 | if (prop === 'readText') { |
| 761 | return async () => { |
| 762 | throw cause; |
| 763 | }; |
| 764 | } |
| 765 | if (prop === 'readLines') { |
| 766 | return async function* () { |
| 767 | yield* []; |
| 768 | throw cause; |
| 769 | }; |
| 770 | } |
| 771 | if (prop === 'withCwd') { |
| 772 | return (cwd: string) => wrapReadTextWithError(target.withCwd(cwd), cause); |
| 773 | } |
| 774 | return Reflect.get(target, prop, receiver); |
| 775 | }, |
| 776 | }); |
| 777 | } |
nothing calls this directly
no test coverage detected