@autobe/agent
Version:
AI backend server code generator
21 lines • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createAutoBeState = void 0;
const createAutoBeState = (histories) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
const reversed = histories.slice().reverse();
return {
analyze: (_a = reversed.find((h) => h.type === "analyze")) !== null && _a !== void 0 ? _a : null,
database: (_b = reversed.find((h) => h.type === "database")) !== null && _b !== void 0 ? _b : null,
interface: (_c = reversed.find((h) => h.type === "interface")) !== null && _c !== void 0 ? _c : null,
test: (_d = reversed.find((h) => h.type === "test")) !== null && _d !== void 0 ? _d : null,
realize: (_e = reversed.find((h) => h.type === "realize")) !== null && _e !== void 0 ? _e : null,
previousAnalyze: (_f = reversed.filter((h) => h.type === "analyze")[1]) !== null && _f !== void 0 ? _f : null,
previousDatabase: (_g = reversed.filter((h) => h.type === "database")[1]) !== null && _g !== void 0 ? _g : null,
previousInterface: (_h = reversed.filter((h) => h.type === "interface")[1]) !== null && _h !== void 0 ? _h : null,
previousTest: (_j = reversed.filter((h) => h.type === "test")[1]) !== null && _j !== void 0 ? _j : null,
previousRealize: (_k = reversed.filter((h) => h.type === "realize")[1]) !== null && _k !== void 0 ? _k : null,
};
};
exports.createAutoBeState = createAutoBeState;
//# sourceMappingURL=createAutoBeState.js.map