Files
clawdbot/src/daemon/runtime-parse.ts
Peter Steinberger c379191f80 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00

15 lines
511 B
TypeScript

export function parseKeyValueOutput(output: string, separator: string): Record<string, string> {
const entries: Record<string, string> = {};
for (const rawLine of output.split(/\r?\n/)) {
const line = rawLine.trim();
if (!line) continue;
const idx = line.indexOf(separator);
if (idx <= 0) continue;
const key = line.slice(0, idx).trim().toLowerCase();
if (!key) continue;
const value = line.slice(idx + separator.length).trim();
entries[key] = value;
}
return entries;
}