~james/core

core/web/src/lib/components/shell/topbarSearch.ts -rw-r--r-- 295 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 15 hours ago
                                                                                
1
2
3
4
5
6
7
8
export const QUICK_SEARCH_LIMIT = 5;

export const QUICK_SEARCH_DELAY = 150;

export const moveActive = (index: number, delta: 1 | -1, count: number): number =>
	Math.min(Math.max(index + delta, -1), count - 1);

export const shortcutLabel = (mac: boolean): string => (mac ? "⌘K" : "Ctrl+K");