(_, prop, receiver)
| 24 | export function createSafeClient<T extends NestedClient<any>>(client: T): SafeClient<T> { |
| 25 | const proxy = new Proxy((...args: any[]) => safe((client as any)(...args)), { |
| 26 | get(_, prop, receiver) { |
| 27 | const value = Reflect.get(client, prop, receiver) |
| 28 | |
| 29 | if (typeof prop !== 'string') { |
| 30 | return value |
| 31 | } |
| 32 | |
| 33 | if (!isTypescriptObject(value)) { |
| 34 | return value |
| 35 | } |
| 36 | |
| 37 | return createSafeClient(value as NestedClient<any>) |
| 38 | }, |
| 39 | }) |
| 40 | |
| 41 | return proxy as SafeClient<T> |
nothing calls this directly
no test coverage detected