// A position in a list of `count` items that wraps around both ways: one // past the last is the first, one before the first is the last. Used for // browsing photos in the hero and the lightbox. export function wrapIndex(index: number, count: number): number { return ((index % count) + count) % count; }