MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / toCamelCase

Function toCamelCase

packages/cli/src/actions/pull/casing.ts:32–35  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

30}
31
32export function toCamelCase(str: string): string {
33 if (isAllUpperCase(str)) return str;
34 return str.replace(/[_\- ]+(\w)/g, (_, c) => c.toUpperCase()).replace(/^\w/, (c) => c.toLowerCase());
35}
36
37export function toSnakeCase(str: string): string {
38 if (isAllUpperCase(str)) return str;

Callers 2

casing.test.tsFile · 0.90
resolveNameCasingFunction · 0.85

Calls 1

isAllUpperCaseFunction · 0.85

Tested by

no test coverage detected