Files
gites/src/lib/recents.ts
T
szaman 58268c4015
ci / check (push) Successful in 4m13s
release / release (push) Successful in 9m54s
Commit preview panel at the bottom; open other repositories from a recent list or a folder picker
2026-10-15 00:00:12 +02:00

7 lines
266 B
TypeScript

export const MAX_RECENTS = 12;
/** Puts `path` first, drops an older copy of it, and keeps at most MAX_RECENTS paths. */
export function addRecent(list: string[], path: string): string[] {
return [path, ...list.filter((p) => p !== path)].slice(0, MAX_RECENTS);
}