( folderIcons: Record<string, FolderIconId>, folder: NoteFolder, sourceSubpath: string, targetSubpath: string )
| 1068 | } |
| 1069 | |
| 1070 | function duplicateFolderIcons( |
| 1071 | folderIcons: Record<string, FolderIconId>, |
| 1072 | folder: NoteFolder, |
| 1073 | sourceSubpath: string, |
| 1074 | targetSubpath: string |
| 1075 | ): Record<string, FolderIconId> { |
| 1076 | const next: Record<string, FolderIconId> = { ...folderIcons } |
| 1077 | const exactKey = folderIconKey(folder, sourceSubpath) |
| 1078 | const prefix = `${exactKey}/` |
| 1079 | for (const [key, value] of Object.entries(folderIcons)) { |
| 1080 | if (key === exactKey) { |
| 1081 | next[folderIconKey(folder, targetSubpath)] = value |
| 1082 | continue |
| 1083 | } |
| 1084 | if (key.startsWith(prefix)) { |
| 1085 | next[folderIconKey(folder, targetSubpath) + key.slice(exactKey.length)] = value |
| 1086 | } |
| 1087 | } |
| 1088 | return next |
| 1089 | } |
| 1090 | |
| 1091 | async function inferPrimaryNotesLocation(root: string): Promise<PrimaryNotesLocation> { |
| 1092 | let entries: Dirent[] |
no test coverage detected