(obj: Record<string, any>, prefix = "")
| 137 | ]) |
| 138 | |
| 139 | function getConfigKeyPaths(obj: Record<string, any>, prefix = ""): string[] { |
| 140 | const keys: string[] = [] |
| 141 | for (const key of Object.keys(obj)) { |
| 142 | const fullKey = prefix ? `${prefix}.${key}` : key |
| 143 | keys.push(fullKey) |
| 144 | |
| 145 | // model*Limits are dynamic maps keyed by providerID/modelID; do not recurse into arbitrary IDs. |
| 146 | if (fullKey === "compress.modelMaxLimits" || fullKey === "compress.modelMinLimits") { |
| 147 | continue |
| 148 | } |
| 149 | |
| 150 | if (obj[key] && typeof obj[key] === "object" && !Array.isArray(obj[key])) { |
| 151 | keys.push(...getConfigKeyPaths(obj[key], fullKey)) |
| 152 | } |
| 153 | } |
| 154 | return keys |
| 155 | } |
| 156 | |
| 157 | export function getInvalidConfigKeys(userConfig: Record<string, any>): string[] { |
| 158 | const userKeys = getConfigKeyPaths(userConfig) |
no outgoing calls
no test coverage detected