MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / resolveMethodName

Function resolveMethodName

vmm/ui/src/lib/vmmRpcClient.ts:40–58  ·  view source on GitHub ↗
(method: any)

Source from the content-addressed store, hash-verified

38}
39
40function resolveMethodName(method: any) {
41 if (!method) {
42 return '';
43 }
44 const type = typeof method;
45 if (type === 'string') {
46 return method;
47 }
48 if (type === 'function' || type === 'object') {
49 if (method.name) {
50 return method.name.charAt(0).toUpperCase() + method.name.slice(1);
51 }
52 if (method.fullName) {
53 const parts = String(method.fullName).split('.');
54 return parts[parts.length - 1];
55 }
56 }
57 return String(method);
58}
59
60export function getVmmRpcClient(basePath = '/prpc') {
61 if (cachedClient) {

Callers 1

rpcImplFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected