(note: NoteMeta, notes: NoteMeta[])
| 116 | } |
| 117 | |
| 118 | function noteTargetFor(note: NoteMeta, notes: NoteMeta[]): string { |
| 119 | const titleNeedle = normalize(note.title) |
| 120 | const titleMatches = notes.filter( |
| 121 | (candidate) => |
| 122 | candidate.folder !== 'trash' && normalize(candidate.title) === titleNeedle |
| 123 | ) |
| 124 | if (titleMatches.length === 1) return note.title |
| 125 | |
| 126 | const rel = stripMdExtension(note.path) |
| 127 | if (note.folder === 'inbox' && isPrimaryNotesAtRoot(useStore.getState().vaultSettings)) { |
| 128 | return `/${rel}` |
| 129 | } |
| 130 | if (rel.startsWith('inbox/')) return `/${rel.slice('inbox/'.length)}` |
| 131 | return rel |
| 132 | } |
| 133 | |
| 134 | function scoreAsset(asset: AssetMeta, query: string, activePath: string | null): number { |
| 135 | const name = normalize(asset.name) |
no test coverage detected