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

Function buildColorCacheKey

apps/sim/lib/pptx-renderer/renderer/style-resolver.ts:19–33  ·  view source on GitHub ↗

* Build a cache key for a color node based on its tag, value, and modifiers.

(colorNode: SafeXmlNode)

Source from the content-addressed store, hash-verified

17 * Build a cache key for a color node based on its tag, value, and modifiers.
18 */
19function buildColorCacheKey(colorNode: SafeXmlNode): string {
20 const parts: string[] = [colorNode.localName, colorNode.attr('val') ?? '']
21 for (const child of colorNode.allChildren()) {
22 const tag = child.localName
23 const val = child.attr('val')
24 if (tag) parts.push(`${tag}:${val ?? ''}`)
25 // Include nested color children for wrapper nodes
26 for (const grandchild of child.allChildren()) {
27 const gtag = grandchild.localName
28 const gval = grandchild.attr('val')
29 if (gtag) parts.push(`${gtag}:${gval ?? ''}`)
30 }
31 }
32 return parts.join('|')
33}
34
35/**
36 * Collect OOXML color modifier children from a color node.

Callers 1

resolveColorFunction · 0.85

Calls 4

attrMethod · 0.80
allChildrenMethod · 0.80
joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected