(target, prop)
| 47 | ): ClientDurableIterator<T, RPC> { |
| 48 | const proxy = new Proxy(iterator, { |
| 49 | get(target, prop) { |
| 50 | const token = options.getToken() |
| 51 | const { rpc: allowMethods } = parseDurableIteratorToken(token) |
| 52 | |
| 53 | if (prop === CLIENT_DURABLE_ITERATOR_TOKEN_SYMBOL) { |
| 54 | return token |
| 55 | } |
| 56 | |
| 57 | if (typeof prop === 'string' && allowMethods?.includes(prop)) { |
| 58 | return createORPCClient(link, { path: [prop] }) |
| 59 | } |
| 60 | |
| 61 | const v = Reflect.get(target, prop) |
| 62 | return typeof v === 'function' |
| 63 | ? v.bind(target) // Require .bind itself for calling |
| 64 | : v |
| 65 | }, |
| 66 | }) |
| 67 | |
| 68 | return proxy as any |
nothing calls this directly
no test coverage detected