MCPcopy Create free account
hub / github.com/middleapi/orpc / get

Function get

packages/durable-iterator/src/client/iterator.ts:49–65  ·  view source on GitHub ↗
(target, prop)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

createORPCClientFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected