MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / camelCaseToWords

Function camelCaseToWords

apps/start/src/utils/casing.ts:1–9  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

1export const camelCaseToWords = (str: string) => {
2 return str
3 .replaceAll('_', ' ')
4 .trim()
5 .replaceAll(/([A-Z])/g, ' $1')
6 .trim()
7 .replace(/^./, (str) => str.toUpperCase())
8 .replaceAll(/\s./g, (str) => str.toUpperCase());
9};

Callers 1

defaultRenderKeyFunction · 0.90

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected