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

Function findXfrm

apps/sim/lib/pptx-renderer/model/nodes/base-node.ts:78–99  ·  view source on GitHub ↗

* Find the transform (xfrm) node. Shapes use `p:spPr > a:xfrm`, * groups use `p:grpSpPr > a:xfrm`, graphic frames use `p:xfrm`.

(node: SafeXmlNode)

Source from the content-addressed store, hash-verified

76 * groups use `p:grpSpPr > a:xfrm`, graphic frames use `p:xfrm`.
77 */
78function findXfrm(node: SafeXmlNode): SafeXmlNode {
79 // Try spPr first (most shapes)
80 const spPr = node.child('spPr')
81 if (spPr.exists()) {
82 const xfrm = spPr.child('xfrm')
83 if (xfrm.exists()) return xfrm
84 }
85
86 // Try grpSpPr (groups)
87 const grpSpPr = node.child('grpSpPr')
88 if (grpSpPr.exists()) {
89 const xfrm = grpSpPr.child('xfrm')
90 if (xfrm.exists()) return xfrm
91 }
92
93 // Try direct xfrm (graphic frames)
94 const directXfrm = node.child('xfrm')
95 if (directXfrm.exists()) return directXfrm
96
97 // Return empty node — all reads will return defaults
98 return node.child('__nonexistent__')
99}
100
101/**
102 * Parse placeholder info from nvPr > p:ph.

Callers 1

parseBasePropsFunction · 0.85

Calls 2

childMethod · 0.80
existsMethod · 0.80

Tested by

no test coverage detected