(favorites: string[], key: string)
| 565 | |
| 566 | /** Toggle a favorite key, returning the next list (added at the end, or removed). */ |
| 567 | export function toggleFavorite(favorites: string[], key: string): string[] { |
| 568 | return favorites.includes(key) |
| 569 | ? favorites.filter((f) => f !== key) |
| 570 | : [...favorites, key] |
| 571 | } |
| 572 | |
| 573 | /** Rewrite a note favorite when its path changes (rename or move). */ |
| 574 | export function rewriteFavoriteNotePath( |
no outgoing calls
no test coverage detected