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

Function zapVisit

devtool/src/graphSerializer.ts:234–247  ·  view source on GitHub ↗
(nodeId: string, depth: number, graph: Dagre.Graph, registry: ZapRegistry)

Source from the content-addressed store, hash-verified

232}
233
234function zapVisit(nodeId: string, depth: number, graph: Dagre.Graph, registry: ZapRegistry) {
235 if (registry.has(nodeId)) {
236 return;
237 } else {
238 const node: StreamGraphNode = graph.node(nodeId);
239 if (node.type !== 'operator') {
240 registry.register(nodeId, node.stream, depth);
241 }
242 const successors: Array<string> = graph['successors'](nodeId);
243 successors.forEach(id => {
244 zapVisit(id, depth + 1, graph, registry);
245 });
246 }
247}
248
249function makeObjectifyGraph(id$: Stream<string>) {
250 return function objectifyGraph(diagram$: Stream<Diagram>): Stream<Object> {

Callers 1

setupZappingFunction · 0.85

Calls 2

hasMethod · 0.80
registerMethod · 0.80

Tested by

no test coverage detected