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

Function toPascalCase

scripts/codegen/rust.ts:89–99  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

87// ── Naming helpers ──────────────────────────────────────────────────────────
88
89function toPascalCase(s: string): string {
90 const name = fixBrandCasing(
91 s
92 .split(/[^A-Za-z0-9]+/)
93 .filter(Boolean)
94 .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
95 .join(""),
96 );
97 if (!name) return "Value";
98 return /^[0-9]/.test(name) ? `Value${name}` : name;
99}
100
101function toRustPascalIdentifier(value: string, fallback: string): string {
102 let identifier = toPascalCase(value);

Callers 10

toRustPascalIdentifierFunction · 0.70
tryEmitRustUnionFunction · 0.70
rustRefTypeNameFunction · 0.70
resolveRustTypeFunction · 0.70
extractEventVariantsFunction · 0.70
rustParamsTypeNameFunction · 0.70
rustResultTypeNameFunction · 0.70
generateApiTypesCodeFunction · 0.70
buildNamespaceTreeFunction · 0.70
getResultTypeNameFunction · 0.70

Calls 2

joinMethod · 0.80
fixBrandCasingFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…