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

Function transformProviderData

packages/agent-core/src/config/toml.ts:346–359  ·  view source on GitHub ↗
(data: Record<string, unknown>)

Source from the content-addressed store, hash-verified

344}
345
346function transformProviderData(data: Record<string, unknown>): Record<string, unknown> {
347 const out: Record<string, unknown> = {};
348 for (const [key, value] of Object.entries(data)) {
349 const targetKey = snakeToCamel(key);
350 if (targetKey === 'oauth') {
351 out[targetKey] = isPlainObject(value) ? transformPlainObject(value) : value;
352 } else if (targetKey === 'env' || targetKey === 'customHeaders') {
353 out[targetKey] = cloneObjectValue(value);
354 } else {
355 out[targetKey] = value;
356 }
357 }
358 return out;
359}
360
361function transformModelData(data: Record<string, unknown>): Record<string, unknown> {
362 const out = transformPlainObject(data);

Callers

nothing calls this directly

Calls 4

transformPlainObjectFunction · 0.85
cloneObjectValueFunction · 0.85
snakeToCamelFunction · 0.70
isPlainObjectFunction · 0.70

Tested by

no test coverage detected