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

Function describeTomlSyntaxError

packages/agent-core/src/config/toml.ts:257–263  ·  view source on GitHub ↗

* One-line summary of a smol-toml parse error: first message line plus the * line/column location, without the multi-line code-frame block.

(error: unknown)

Source from the content-addressed store, hash-verified

255 * line/column location, without the multi-line code-frame block.
256 */
257function describeTomlSyntaxError(error: unknown): string {
258 const firstLine = describeUnknownError(error).split('\n', 1)[0] ?? '';
259 if (error instanceof TomlError) {
260 return `${firstLine} (line ${error.line}, column ${error.column})`;
261 }
262 return firstLine;
263}
264
265export function parseConfigString(tomlText: string, filePath = 'config.toml'): KimiConfig {
266 if (tomlText.trim().length === 0) {

Callers 1

loadRuntimeConfigSafeFunction · 0.85

Calls 1

describeUnknownErrorFunction · 0.85

Tested by

no test coverage detected