MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / toggleFavorite

Function toggleFavorite

packages/app-core/src/lib/vault-layout.ts:567–571  ·  view source on GitHub ↗
(favorites: string[], key: string)

Source from the content-addressed store, hash-verified

565
566/** Toggle a favorite key, returning the next list (added at the end, or removed). */
567export 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). */
574export function rewriteFavoriteNotePath(

Callers 2

SidebarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected