MCPcopy Create free account
hub / github.com/agent-tower/core / flattenObject

Function flattenObject

packages/server/src/executors/codex.executor.ts:35–46  ·  view source on GitHub ↗

* 将嵌套对象展平为 dotted path 键值对(递归到标量叶子) * { model_providers: { azure: { name: "A", query_params: { "api-version": "v1" } } } } * → [ * ["model_providers.azure.name", "A"], * ["model_providers.azure.query_params.api-version", "v1"], * ]

(obj: Record<string, unknown>, prefix = '')

Source from the content-addressed store, hash-verified

33 AGENT_TOWER_MCP_IDENTITY_ENV_KEYS,
34 AGENT_TOWER_MCP_SERVICE_ENV_KEYS,
35} from './execution-env.js';
36import {
37 CODEX_OPENAI_COMPATIBLE_PROVIDER_ID,
38 CODEX_OPENAI_COMPATIBLE_PROVIDER_NAME,
39} from '../services/provider-effective-connection.service.js';
40
41/**
42 * 将嵌套对象展平为 dotted path 键值对(递归到标量叶子)
43 * { model_providers: { azure: { name: "A", query_params: { "api-version": "v1" } } } }
44 * → [
45 * ["model_providers.azure.name", "A"],
46 * ["model_providers.azure.query_params.api-version", "v1"],
47 * ]
48 */
49function flattenObject(obj: Record<string, unknown>, prefix = ''): [string, unknown][] {

Callers 1

buildConfigOverridesMethod · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected