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

Function removeFavoritesForFolder

packages/app-core/src/lib/vault-layout.ts:622–636  ·  view source on GitHub ↗
(
  favorites: string[],
  folder: NoteFolder,
  subpath: string,
  relPrefix: string
)

Source from the content-addressed store, hash-verified

620 * vault-relative folder path with trailing slash).
621 */
622export function removeFavoritesForFolder(
623 favorites: string[],
624 folder: NoteFolder,
625 subpath: string,
626 relPrefix: string
627): string[] {
628 const exactKey = favoriteFolderKey(folder, subpath)
629 const keyPrefix = `${exactKey}/`
630 return favorites.filter(
631 (f) =>
632 f !== exactKey &&
633 !f.startsWith(keyPrefix) &&
634 !(relPrefix && f.startsWith(relPrefix))
635 )
636}
637
638export function rewriteFolderIconsForRename(
639 folderIcons: Record<string, FolderIconId>,

Callers 2

store.tsFile · 0.90

Calls 1

favoriteFolderKeyFunction · 0.85

Tested by

no test coverage detected