MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / createWidthHelper

Function createWidthHelper

cli/src/hooks/use-terminal-layout.ts:81–96  ·  view source on GitHub ↗
(size: TerminalWidthSize)

Source from the content-addressed store, hash-verified

79 * Create a width layout helper for a given size.
80 */
81const createWidthHelper = (size: TerminalWidthSize): WidthLayoutHelper => {
82 const sizeIndex = WIDTH_SIZE_ORDER.indexOf(size)
83
84 return {
85 size,
86 is: (targetSize: TerminalWidthSize) => size === targetSize,
87 atLeast: (targetSize: TerminalWidthSize) => {
88 const targetIndex = WIDTH_SIZE_ORDER.indexOf(targetSize)
89 return sizeIndex >= targetIndex
90 },
91 atMost: (targetSize: TerminalWidthSize) => {
92 const targetIndex = WIDTH_SIZE_ORDER.indexOf(targetSize)
93 return sizeIndex <= targetIndex
94 },
95 }
96}
97
98/**
99 * Create a height layout helper for a given size.

Callers 1

computeTerminalLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected