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

Function normalizeEdge

apps/sim/lib/workflows/comparison/normalize.ts:267–281  ·  view source on GitHub ↗
(edge: Edge)

Source from the content-addressed store, hash-verified

265 * @returns Normalized edge with only connection fields
266 */
267export function normalizeEdge(edge: Edge): NormalizedEdge {
268 const normalized: NormalizedEdge = {
269 source: edge.source,
270 target: edge.target,
271 }
272 // Only include handles if they have a non-null value
273 // This treats null and undefined as equivalent (both omitted)
274 if (edge.sourceHandle != null) {
275 normalized.sourceHandle = edge.sourceHandle
276 }
277 if (edge.targetHandle != null) {
278 normalized.targetHandle = edge.targetHandle
279 }
280 return normalized
281}
282
283/**
284 * Sorts edges for consistent comparison

Callers 1

normalize.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected