toPascalCase() — astro Function Reference
Architecture documentation for the toPascalCase() function in utils.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 0e78e617_6e9f_a2f4_2b15_e4151d28132b["toPascalCase()"] 6db4d7db_edbb_c18d_7ff5_decb13f1c284["utils.ts"] 0e78e617_6e9f_a2f4_2b15_e4151d28132b -->|defined in| 6db4d7db_edbb_c18d_7ff5_decb13f1c284 9bb1c1ce_4618_e68d_330b_fc8221783511["classNameFromFilename()"] 9bb1c1ce_4618_e68d_330b_fc8221783511 -->|calls| 0e78e617_6e9f_a2f4_2b15_e4151d28132b style 0e78e617_6e9f_a2f4_2b15_e4151d28132b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/language-tools/language-server/src/core/utils.ts lines 41–50
function toPascalCase(string: string) {
return `${string}`
.replace(new RegExp(/[-_]+/, 'g'), ' ')
.replace(new RegExp(/[^\w\s]/, 'g'), '')
.replace(
new RegExp(/\s+(.)(\w*)/, 'g'),
(_, $2, $3) => `${$2.toUpperCase() + $3.toLowerCase()}`,
)
.replace(new RegExp(/\w/), (s) => s.toUpperCase());
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does toPascalCase() do?
toPascalCase() is a function in the astro codebase, defined in packages/language-tools/language-server/src/core/utils.ts.
Where is toPascalCase() defined?
toPascalCase() is defined in packages/language-tools/language-server/src/core/utils.ts at line 41.
What calls toPascalCase()?
toPascalCase() is called by 1 function(s): classNameFromFilename.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free