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

Function buildFontBody

apps/sim/tools/microsoft_excel/format_range.ts:18–26  ·  view source on GitHub ↗

* Builds the font PATCH body from the provided font params, omitting any unset fields. * Returns null when no font property was supplied.

(params: MicrosoftExcelFormatRangeParams)

Source from the content-addressed store, hash-verified

16 * Returns null when no font property was supplied.
17 */
18function buildFontBody(params: MicrosoftExcelFormatRangeParams): Record<string, unknown> | null {
19 const body: Record<string, unknown> = {}
20 if (params.fontBold !== undefined) body.bold = params.fontBold
21 if (params.fontItalic !== undefined) body.italic = params.fontItalic
22 if (params.fontColor) body.color = params.fontColor
23 if (params.fontSize !== undefined) body.size = params.fontSize
24 if (params.fontName) body.name = params.fontName
25 return Object.keys(body).length > 0 ? body : null
26}
27
28/**
29 * Formats a worksheet range by applying fill color and/or font properties.

Callers 1

format_range.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected