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

Function extractFormatCode

apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts:138–150  ·  view source on GitHub ↗

* Extract the formatCode from a numRef > numCache > formatCode structure.

(refNode: SafeXmlNode)

Source from the content-addressed store, hash-verified

136 * Extract the formatCode from a numRef > numCache > formatCode structure.
137 */
138function extractFormatCode(refNode: SafeXmlNode): string | undefined {
139 const cache = refNode.child('numRef').exists()
140 ? refNode.child('numRef').child('numCache')
141 : refNode.child('numCache')
142
143 if (!cache.exists()) return undefined
144
145 const fc = cache.child('formatCode')
146 if (!fc.exists()) return undefined
147
148 const text = fc.text()
149 return text || undefined
150}
151
152/**
153 * Format a numeric value according to its numCache formatCode.

Callers 1

parseSeriesFunction · 0.85

Calls 3

existsMethod · 0.80
childMethod · 0.80
textMethod · 0.80

Tested by

no test coverage detected