reports/frontend/node_modules/es-toolkit/dist/string/pascalCase.mjs
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

22 lines
845 B
JavaScript

import { capitalize } from "./capitalize.mjs";
import { words } from "./words.mjs";
//#region src/string/pascalCase.ts
/**
* Converts a string to Pascal case.
*
* Pascal case is the naming convention in which each word is capitalized and concatenated without any separator characters.
*
* @param str - The string that is to be changed to pascal case.
* @returns The converted string to Pascal case.
*
* @example
* const convertedStr1 = pascalCase('pascalCase') // returns 'PascalCase'
* const convertedStr2 = pascalCase('some whitespace') // returns 'SomeWhitespace'
* const convertedStr3 = pascalCase('hyphen-text') // returns 'HyphenText'
* const convertedStr4 = pascalCase('HTTPRequest') // returns 'HttpRequest'
*/
function pascalCase(str) {
return words(str).map((word) => capitalize(word)).join("");
}
//#endregion
export { pascalCase };