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

Function createHeightHelper

cli/src/hooks/use-terminal-layout.ts:101–116  ·  view source on GitHub ↗
(size: TerminalHeightSize)

Source from the content-addressed store, hash-verified

99 * Create a height layout helper for a given size.
100 */
101const createHeightHelper = (size: TerminalHeightSize): HeightLayoutHelper => {
102 const sizeIndex = HEIGHT_SIZE_ORDER.indexOf(size)
103
104 return {
105 size,
106 is: (targetSize: TerminalHeightSize) => size === targetSize,
107 atLeast: (targetSize: TerminalHeightSize) => {
108 const targetIndex = HEIGHT_SIZE_ORDER.indexOf(targetSize)
109 return sizeIndex >= targetIndex
110 },
111 atMost: (targetSize: TerminalHeightSize) => {
112 const targetIndex = HEIGHT_SIZE_ORDER.indexOf(targetSize)
113 return sizeIndex <= targetIndex
114 },
115 }
116}
117
118/**
119 * Determine the width layout size from terminal width.

Callers 1

computeTerminalLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected