( favorites: string[], folder: NoteFolder, subpath: string, relPrefix: string )
| 620 | * vault-relative folder path with trailing slash). |
| 621 | */ |
| 622 | export 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 | |
| 638 | export function rewriteFolderIconsForRename( |
| 639 | folderIcons: Record<string, FolderIconId>, |
no test coverage detected