Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
292 B · 10 lines
TypeScript
1234567891011export type BadgeNavigationDirection = -1 | 1;
export function getAdjacentBadgeIndex( currentIndex: number, badgeCount: number, direction: BadgeNavigationDirection,): number | null { if (badgeCount <= 0) return null; return (currentIndex + direction + badgeCount) % badgeCount;}