MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / formatIssuePath

Function formatIssuePath

apps/kimi-code/src/cli/sub/doctor.ts:324–338  ·  view source on GitHub ↗
(path: readonly PropertyKey[])

Source from the content-addressed store, hash-verified

322}
323
324function formatIssuePath(path: readonly PropertyKey[]): string {
325 if (path.length === 0) return '<root>';
326
327 let out = '';
328 for (const segment of path) {
329 if (typeof segment === 'number') {
330 out += `[${String(segment)}]`;
331 } else if (out.length === 0) {
332 out = camelToSnake(String(segment));
333 } else {
334 out += `.${camelToSnake(String(segment))}`;
335 }
336 }
337 return out;
338}
339
340function camelToSnake(value: string): string {
341 return value.replaceAll(/[A-Z]/g, (ch) => `_${ch.toLowerCase()}`);

Callers 1

formatErrorMessageFunction · 0.85

Calls 1

camelToSnakeFunction · 0.70

Tested by

no test coverage detected