"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tryJson = tryJson;
/** JSON.parse → undefined on malformed lines (CLIs sometimes emit blank
 *  lines, log lines, or partial frames in error paths). */
function tryJson(line) {
    const trimmed = line.trim();
    if (trimmed.length === 0)
        return undefined;
    try {
        return JSON.parse(trimmed);
    }
    catch {
        return undefined;
    }
}
//# sourceMappingURL=shared.js.map