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

Function get

packages/client/src/client-safe.ts:26–38  ·  view source on GitHub ↗
(_, prop, receiver)

Source from the content-addressed store, hash-verified

24export 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>

Callers

nothing calls this directly

Calls 3

isTypescriptObjectFunction · 0.90
createSafeClientFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected