MCPcopy Create free account
hub / github.com/codeaashu/claude-code / applyPositionEdge

Function applyPositionEdge

src/ink/styles.ts:420–432  ·  view source on GitHub ↗
(
  node: LayoutNode,
  edge: 'top' | 'bottom' | 'left' | 'right',
  v: number | `${number}%` | undefined,
)

Source from the content-addressed store, hash-verified

418}
419
420function applyPositionEdge(
421 node: LayoutNode,
422 edge: 'top' | 'bottom' | 'left' | 'right',
423 v: number | `${number}%` | undefined,
424): void {
425 if (typeof v === 'string') {
426 node.setPositionPercent(edge, Number.parseInt(v, 10))
427 } else if (typeof v === 'number') {
428 node.setPosition(edge, v)
429 } else {
430 node.setPosition(edge, Number.NaN)
431 }
432}
433
434const applyOverflowStyles = (node: LayoutNode, style: Styles): void => {
435 // Yoga's Overflow controls whether children expand the container.

Callers 1

applyPositionStylesFunction · 0.85

Calls 2

setPositionPercentMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected