(refl: DeclarationReflection)
| 30 | const refMap = typesMap(reflection); |
| 31 | |
| 32 | function recoverRefs(refl: DeclarationReflection) { |
| 33 | const refs = extractRefs(refl); |
| 34 | |
| 35 | const missingRefs = new Set<number>(); |
| 36 | refs.forEach((id) => { |
| 37 | if (refMap[id]) return; |
| 38 | missingRefs.add(id); |
| 39 | }); |
| 40 | |
| 41 | missingRefs.forEach((id) => { |
| 42 | const missingRef = map[id]; |
| 43 | if (!missingRef) return; |
| 44 | |
| 45 | recoveredRefs.add(missingRef); |
| 46 | |
| 47 | // Update map, to avoid adding types included with the missing ref |
| 48 | refMap[id] = missingRef; |
| 49 | Object.assign(refMap, typesMap(missingRef)); |
| 50 | |
| 51 | // Recursively recover missing refs |
| 52 | recoverRefs(missingRef); |
| 53 | }); |
| 54 | } |
| 55 | |
| 56 | recoverRefs(reflection); |
| 57 |
no test coverage detected