MCPcopy Index your code
hub / github.com/refined-github/refined-github / getItemsBetween

Function getItemsBetween

source/helpers/get-items-between.ts:4–9  ·  view source on GitHub ↗
(items: T[], previous: T | undefined, current: T)

Source from the content-addressed store, hash-verified

2Get the items between previous and current, both ends included. If `previous` is missing, start from 0
3*/
4export 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}

Callers 2

batchToggleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected