INNER CODE UNIT · TypeScript
m
x-cmd/x-cmd · mod/ajv/lib/ajv.ts:154
let m = /\(line\s+(\d+)\s+column\s+(\d+)\)/i.exec(msg);
if (m) return { line: +m[1], column: +m[2] };
// YAML / TOML: "at line N, column M" or "on line N, column M"
m = /(?:at|on)\s+line\s+(\d+),?\s+column\s+(\d+)/i.exec(msg);
if (m) return { line: +m[1], column: +m[2] };
// YAML fallback: "line N, column M"
m = /\bline\s+(\d+),?\s+column\s+(\d+)/i.exec(msg);
if (m) return { line: +m[1], column: +m[2] };
return null;
}
}
// Emit an error in x-cmd's log format so it integrates with the rest of
// the toolchain. Metadata is rendered as siblings of the main message
// (no `more:` block) so it stays easy to grep / pipe.
function logError(msg: string, meta?: Record<string, string>): void {
console.error(`- E|ajv: ${msg}`);
if (meta) {