MCPcopy Index your code
hub / github.com/codeaashu/claude-code / setTextStyles

Function setTextStyles

src/ink/dom.ts:276–289  ·  view source on GitHub ↗
(
  node: DOMElement,
  textStyles: TextStyles,
)

Source from the content-addressed store, hash-verified

274}
275
276export const setTextStyles = (
277 node: DOMElement,
278 textStyles: TextStyles,
279): void => {
280 // Same dirty-check guard as setStyle: React (and buildTextStyles in Text.tsx)
281 // allocate a new textStyles object on every render even when values are
282 // unchanged, so compare by value to avoid markDirty -> yoga re-measurement
283 // on every Text re-render.
284 if (shallowEqual(node.textStyles, textStyles)) {
285 return
286 }
287 node.textStyles = textStyles
288 markDirty(node)
289}
290
291function stylesEqual(a: Styles, b: Styles): boolean {
292 return shallowEqual(a, b)

Callers 1

commitUpdateFunction · 0.85

Calls 2

shallowEqualFunction · 0.85
markDirtyFunction · 0.85

Tested by

no test coverage detected