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

Function resolveInheritance

apps/sim/lib/copilot/vfs/document-style.ts:194–212  ·  view source on GitHub ↗
(id: string, visited = new Set<string>())

Source from the content-addressed store, hash-verified

192 }
193
194 function resolveInheritance(id: string, visited = new Set<string>()): StyleRaw | undefined {
195 if (visited.has(id)) return undefined
196 visited.add(id)
197 const s = styleMap.get(id)
198 if (!s) return undefined
199 if (!s.basedOn) return s
200 const parent = resolveInheritance(s.basedOn, visited)
201 if (!parent) return s
202 // Own properties override parent; undefined falls through to parent
203 return {
204 ...parent,
205 ...s,
206 fontSize: s.fontSize ?? parent.fontSize,
207 bold: s.bold ?? parent.bold,
208 color: s.color ?? parent.color,
209 font: s.font ?? parent.font,
210 themeFont: s.themeFont ?? parent.themeFont,
211 }
212 }
213
214 // Target paragraph styles (character styles excluded — generation works at paragraph level)
215 const targetIds: string[] = ['Normal', 'BodyText', 'Body Text', 'Title', 'Subtitle']

Callers 1

parseDocxStylesFunction · 0.85

Calls 2

getMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected