(s: string)
| 87 | // ── Naming helpers ────────────────────────────────────────────────────────── |
| 88 | |
| 89 | function 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 | |
| 101 | function toRustPascalIdentifier(value: string, fallback: string): string { |
| 102 | let identifier = toPascalCase(value); |
no test coverage detected
searching dependent graphs…