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

Function entriesToDisplay

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

Source from the content-addressed store, hash-verified

3872}
3873
3874const entriesToDisplay = (cursor: number, total: number, maxVisible?: number) => {
3875 const max = maxVisible === undefined ? total : maxVisible
3876 let startIndex = Math.min(total - max, cursor - Math.floor(max / 2))
3877 if (startIndex < 0) {
3878 startIndex = 0
3879 }
3880 const endIndex = Math.min(startIndex + max, total)
3881 return { startIndex, endIndex }
3882}

Callers 4

renderFilesFunction · 0.85
renderMultiSelectChoicesFunction · 0.85
renderSelectChoicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected