MCPcopy Create free account
hub / github.com/Effect-TS/effect / entriesToDisplay

Function entriesToDisplay

packages/effect/src/cli/Prompt.ts:4129–4137  ·  view source on GitHub ↗
(cursor: number, total: number, maxVisible?: number)

Source from the content-addressed store, hash-verified

4127}
4128
4129const entriesToDisplay = (cursor: number, total: number, maxVisible?: number) => {
4130 const max = maxVisible === undefined ? total : maxVisible
4131 let startIndex = Math.min(total - max, cursor - Math.floor(max / 2))
4132 if (startIndex < 0) {
4133 startIndex = 0
4134 }
4135 const endIndex = Math.min(startIndex + max, total)
4136 return { startIndex, endIndex }
4137}

Callers 4

renderFilesFunction · 0.85
renderMultiSelectChoicesFunction · 0.85
renderSelectChoicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected