MCPcopy Create free account
hub / github.com/cyclejs/cyclejs / makeObjectifyGraph

Function makeObjectifyGraph

devtool/src/graphSerializer.ts:249–264  ·  view source on GitHub ↗
(id$: Stream<string>)

Source from the content-addressed store, hash-verified

247}
248
249function makeObjectifyGraph(id$: Stream<string>) {
250 return function objectifyGraph(diagram$: Stream<Diagram>): Stream<Object> {
251 return xs.combine(diagram$, id$)
252 .map(([{graph, zaps$}, id]) => {
253 const object = dagre.graphlib['json'].write(graph);
254 for (let i = 0, N = object.nodes.length; i < N; i++) {
255 delete object.nodes[i].stream;
256 }
257 return zaps$.map(zaps => {
258 object.zaps = zaps;
259 object.id = id;
260 return object;
261 });
262 }).flatten();
263 };
264}
265
266function sinksAreXStream(sinks: Object | null): boolean {
267 if (sinks === null) {

Callers 1

GraphSerializerFunction · 0.85

Calls 1

mapMethod · 0.65

Tested by

no test coverage detected