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

Function singularPascal

scripts/codegen/csharp.ts:1438–1444  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

1436let rpcDefinitions: DefinitionCollections = { definitions: {}, $defs: {} };
1437
1438function singularPascal(s: string): string {
1439 const p = toPascalCase(s);
1440 if (p.endsWith("ies")) return `${p.slice(0, -3)}y`;
1441 if (/(xes|zes|ches|shes|sses)$/i.test(p)) return p.slice(0, -2);
1442 if (p.endsWith("s") && !/(ss|us|is)$/i.test(p)) return p.slice(0, -1);
1443 return p;
1444}
1445
1446function getMethodResultSchema(method: RpcMethod): JSONSchema7 | undefined {
1447 return resolveSchema(method.result, rpcDefinitions) ?? method.result ?? undefined;

Callers 1

resolveRpcTypeFunction · 0.85

Calls 1

toPascalCaseFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…