(cursor: number, total: number, maxVisible?: number)
| 3872 | } |
| 3873 | |
| 3874 | const 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 | } |
no outgoing calls
no test coverage detected