MCPcopy Index your code
hub / github.com/simstudioai/sim / sortEdges

Function sortEdges

apps/sim/lib/workflows/comparison/normalize.ts:288–306  ·  view source on GitHub ↗
(
  edges: Array<{
    source: string
    sourceHandle?: string | null
    target: string
    targetHandle?: string | null
  }>
)

Source from the content-addressed store, hash-verified

286 * @returns Sorted array of normalized edges
287 */
288export function sortEdges(
289 edges: Array<{
290 source: string
291 sourceHandle?: string | null
292 target: string
293 targetHandle?: string | null
294 }>
295): Array<{
296 source: string
297 sourceHandle?: string | null
298 target: string
299 targetHandle?: string | null
300}> {
301 return [...edges].sort((a, b) =>
302 `${a.source}-${a.sourceHandle}-${a.target}-${a.targetHandle}`.localeCompare(
303 `${b.source}-${b.sourceHandle}-${b.target}-${b.targetHandle}`
304 )
305 )
306}
307
308/** Block with optional diff markers added by copilot */
309export type BlockWithDiffMarkers = BlockState & {

Callers 2

normalize.test.tsFile · 0.90
normalizeWorkflowStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected