(source: string)
| 189 | } |
| 190 | |
| 191 | export function findArtifactSourceReference(source: string): string | null { |
| 192 | let cursor = 0; |
| 193 | const prefix = 'artifact source lives in'; |
| 194 | while (cursor < source.length) { |
| 195 | const start = source.indexOf('<!--', cursor); |
| 196 | if (start < 0) return null; |
| 197 | const end = source.indexOf('-->', start + 4); |
| 198 | if (end < 0) return null; |
| 199 | const body = source.slice(start + 4, end).trim(); |
| 200 | if (body.toLowerCase().startsWith(prefix)) { |
| 201 | return normalizeArtifactSourceReferencePath(body.slice(prefix.length).trim()); |
| 202 | } |
| 203 | cursor = end + 3; |
| 204 | } |
| 205 | return null; |
| 206 | } |
| 207 | |
| 208 | export function resolveArtifactSourceReferencePath( |
| 209 | currentPath: string, |
no test coverage detected