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

Function parseRels

apps/sim/lib/pptx-renderer/parser/rel-parser.ts:24–45  ·  view source on GitHub ↗
(xmlString: string)

Source from the content-addressed store, hash-verified

22 * ```
23 */
24export function parseRels(xmlString: string): Map<string, RelEntry> {
25 const result = new Map<string, RelEntry>()
26
27 if (!xmlString) return result
28
29 const root = parseXml(xmlString)
30 if (!root.exists()) return result
31
32 const relationships = root.children('Relationship')
33 for (const rel of relationships) {
34 const id = rel.attr('Id')
35 const type = rel.attr('Type')
36 const target = rel.attr('Target')
37 const targetMode = rel.attr('TargetMode')
38
39 if (id && type !== undefined && target !== undefined) {
40 result.set(id, { type, target, targetMode })
41 }
42 }
43
44 return result
45}
46
47/**
48 * Resolve a relative target path against a base path.

Callers 1

buildPresentationFunction · 0.90

Calls 5

parseXmlFunction · 0.90
existsMethod · 0.80
childrenMethod · 0.80
attrMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected