Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

385 B
Raw Blame
import type { DocumentGraphEdge } from "./graph";

export const getDocumentGraphEdgesBySourceId = (
  edges: readonly DocumentGraphEdge[]
) => {
  const result = new Map<string, DocumentGraphEdge[]>();
  for (const edge of edges) {
    const sourceEdges = result.get(edge.sourceId) ?? [];
    sourceEdges.push(edge);
    result.set(edge.sourceId, sourceEdges);
  }
  return result;
};