(items: T[], previous: T | undefined, current: T)
| 2 | Get the items between previous and current, both ends included. If `previous` is missing, start from 0 |
| 3 | */ |
| 4 | export default function getItemsBetween<T>(items: T[], previous: T | undefined, current: T): T[] { |
| 5 | const start = previous ? items.indexOf(previous) : 0; |
| 6 | const end = items.indexOf(current); |
| 7 | |
| 8 | return items.slice(Math.min(start, end), Math.max(start, end) + 1); |
| 9 | } |
no outgoing calls
no test coverage detected