MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / toKebabCase

Function toKebabCase

src/runtime/naming.ts:8–25  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

6 * BuildSimulator -> build-simulator
7 */
8export function toKebabCase(name: string): string {
9 return (
10 name
11 .trim()
12 // Replace underscores with hyphens
13 .replace(/_/g, '-')
14 // Insert hyphen before uppercase letters (for camelCase/PascalCase)
15 .replace(/([a-z])([A-Z])/g, '$1-$2')
16 // Replace spaces with hyphens
17 .replace(/\s+/g, '-')
18 // Convert to lowercase
19 .toLowerCase()
20 // Remove any duplicate hyphens
21 .replace(/-+/g, '-')
22 // Trim leading/trailing hyphens
23 .replace(/^-|-$/g, '')
24 );
25}
26
27/**
28 * Convert kebab-case CLI flag back to camelCase for tool params.

Callers 5

formatNextStepForCliFunction · 0.90
createCliXcodeProxyToolFunction · 0.90
schemaToYargsOptionsFunction · 0.90
createToolCatalogFunction · 0.90
resolveFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected