| 659 | } |
| 660 | |
| 661 | export function removeFolderIcons( |
| 662 | folderIcons: Record<string, FolderIconId>, |
| 663 | folder: NoteFolder, |
| 664 | subpath: string |
| 665 | ): Record<string, FolderIconId> { |
| 666 | const next: Record<string, FolderIconId> = {} |
| 667 | const exactKey = folderIconKey(folder, subpath) |
| 668 | const prefix = `${exactKey}/` |
| 669 | for (const [key, value] of Object.entries(folderIcons)) { |
| 670 | if (key === exactKey || key.startsWith(prefix)) continue |
| 671 | next[key] = value |
| 672 | } |
| 673 | return next |
| 674 | } |
| 675 | |
| 676 | export function duplicateFolderIcons( |
| 677 | folderIcons: Record<string, FolderIconId>, |