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

Function stripGroupDeps

apps/sim/lib/table/workflow-columns.ts:802–818  ·  view source on GitHub ↗
(group: WorkflowGroup, removed: ReadonlySet<string>)

Source from the content-addressed store, hash-verified

800 * changed.
801 */
802export function stripGroupDeps(group: WorkflowGroup, removed: ReadonlySet<string>): WorkflowGroup {
803 const cols = group.dependencies?.columns ?? []
804 const mappings = group.inputMappings ?? []
805 const filteredDeps = cols.filter((d) => !removed.has(d))
806 const filteredMappings = mappings.filter((m) => !removed.has(m.columnName))
807 const depsChanged = filteredDeps.length !== cols.length
808 const mappingsChanged = filteredMappings.length !== mappings.length
809 if (!depsChanged && !mappingsChanged) return group
810 const next: WorkflowGroup = { ...group }
811 if (depsChanged) {
812 next.dependencies = filteredDeps.length > 0 ? { columns: filteredDeps } : undefined
813 }
814 if (mappingsChanged) {
815 next.inputMappings = filteredMappings.length > 0 ? filteredMappings : undefined
816 }
817 return next
818}
819
820/**
821 * Validates schema-level invariants. Run on every `addTableColumn`,

Callers 5

updateTableMetadataFunction · 0.90
updateWorkflowGroupFunction · 0.90
deleteWorkflowGroupFunction · 0.90
deleteColumnFunction · 0.90
deleteColumnsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected