MCPcopy Index your code
hub / github.com/github/copilot-sdk / tsNullableResultTypeName

Function tsNullableResultTypeName

scripts/codegen/typescript.ts:449–461  ·  view source on GitHub ↗
(method: RpcMethod)

Source from the content-addressed store, hash-verified

447}
448
449function tsNullableResultTypeName(method: RpcMethod): string | undefined {
450 const resultSchema = getMethodResultSchema(method);
451 if (!resultSchema) return undefined;
452 const inner = getNullableInner(resultSchema);
453 if (!inner) return undefined;
454 // Resolve $ref to a type name
455 if (inner.$ref) {
456 const refName = inner.$ref.split("/").pop();
457 if (refName) return `${toPascalCase(refName)} | undefined`;
458 }
459 const innerName = getRpcSchemaTypeName(inner, method.rpcMethod.split(".").map(toPascalCase).join("") + "Result");
460 return `${innerName} | undefined`;
461}
462
463function tsResultType(method: RpcMethod): string {
464 if (isVoidSchema(getMethodResultSchema(method))) return "void";

Callers 1

tsResultTypeFunction · 0.85

Calls 6

getNullableInnerFunction · 0.85
getRpcSchemaTypeNameFunction · 0.85
popMethod · 0.80
joinMethod · 0.80
getMethodResultSchemaFunction · 0.70
toPascalCaseFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…