( map: Record<string, T>, folder: NoteFolder, subpath: string )
| 721 | } |
| 722 | |
| 723 | function removeFolderKeyMap<T>( |
| 724 | map: Record<string, T>, |
| 725 | folder: NoteFolder, |
| 726 | subpath: string |
| 727 | ): Record<string, T> { |
| 728 | const next: Record<string, T> = {} |
| 729 | const exactKey = folderIconKey(folder, subpath) |
| 730 | const prefix = `${exactKey}/` |
| 731 | for (const [key, value] of Object.entries(map)) { |
| 732 | if (key === exactKey || key.startsWith(prefix)) continue |
| 733 | next[key] = value |
| 734 | } |
| 735 | return next |
| 736 | } |
| 737 | |
| 738 | function duplicateFolderKeyMap<T>( |
| 739 | map: Record<string, T>, |
no test coverage detected