MCPcopy
hub / github.com/simstudioai/sim / orderKey

Function orderKey

apps/sim/lib/table/workflow-groups/service.ts:712–717  ·  view source on GitHub ↗
(o: { blockId: string; path: string })

Source from the content-addressed store, hash-verified

710 // — regardless of whether they were added at create time or one-by-one.
711 const groupColIdsBefore = new Set(group.outputs.map((o) => o.columnName))
712 const orderKey = (o: { blockId: string; path: string }) => {
713 const d = distances[o.blockId]
714 const dist = d === undefined || d < 0 ? Number.POSITIVE_INFINITY : d
715 const idx = flatIndex.get(`${o.blockId}::${o.path}`) ?? Number.POSITIVE_INFINITY
716 return [dist, idx] as const
717 }
718 const allGroupOutputs = [...group.outputs, newOutput].sort((a, b) => {
719 const [da, ia] = orderKey(a)
720 const [db, ib] = orderKey(b)

Callers 1

addWorkflowGroupOutputFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected