(item: TaskModalProjectItem)
| 95 | } |
| 96 | |
| 97 | export function getTaskModalProjectDedupKeys(item: TaskModalProjectItem): string[] { |
| 98 | const keys = new Set<string>(); |
| 99 | |
| 100 | if (item.file?.path) { |
| 101 | keys.add(`path:${normalizeTaskModalProjectPath(item.file.path)}`); |
| 102 | } |
| 103 | |
| 104 | const parsedPath = parseLinkToPath(item.link); |
| 105 | if (parsedPath) { |
| 106 | keys.add(`path:${normalizeTaskModalProjectPath(parsedPath)}`); |
| 107 | } |
| 108 | |
| 109 | if (item.link) { |
| 110 | keys.add(`link:${item.link.trim().toLowerCase()}`); |
| 111 | } |
| 112 | |
| 113 | return Array.from(keys); |
| 114 | } |
| 115 | |
| 116 | export function normalizeTaskModalProjectPath(path: string): string { |
| 117 | return path.trim().replace(/\.md$/i, "").toLowerCase(); |
no test coverage detected