@syntest/cfg
Version:
A Control Flow Graph package
27 lines • 888 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeSerializeable = void 0;
function makeFunctionSerializeable(cff) {
return {
id: cff.id,
name: cff.name,
entry: cff.graph.entry.id,
successExit: cff.graph.successExit.id,
errorExit: cff.graph.errorExit.id,
nodes: [...cff.graph.nodes.values()],
edges: [...cff.graph.edges],
};
}
function makeSerializeable(cfp) {
const data = {
entry: cfp.graph.entry.id,
successExit: cfp.graph.successExit.id,
errorExit: cfp.graph.errorExit.id,
nodes: [...cfp.graph.nodes.values()],
edges: [...cfp.graph.edges],
functions: cfp.functions.map((function_) => makeFunctionSerializeable(function_)),
};
return data;
}
exports.makeSerializeable = makeSerializeable;
//# sourceMappingURL=format.js.map