* Whether the index records one named call. * * Asked rather than assumed, and asked with the same reading the chains are * built from, so the two cannot disagree. Answers `undefined` when there is * nothing to ask with, which a surface reports as "nobody could look" and never * as "no".
(
index: BugPathIndex,
project: string,
from: BugPathNode,
to: BugPathNode,
)
| 453 | * as "no". |
| 454 | */ |
| 455 | async function callIsRecorded( |
| 456 | index: BugPathIndex, |
| 457 | project: string, |
| 458 | from: BugPathNode, |
| 459 | to: BugPathNode, |
| 460 | ): Promise<boolean | undefined> { |
| 461 | if (to.qualifiedName === undefined) { |
| 462 | return undefined; |
| 463 | } |
| 464 | const callers = await callersOf(index, project, to.qualifiedName); |
| 465 | if (from.qualifiedName !== undefined) { |
| 466 | return callers.some((caller) => caller.qualifiedName === from.qualifiedName); |
| 467 | } |
| 468 | const key = nodeKey(from); |
| 469 | return callers.some((caller) => nodeKey(caller) === key); |
| 470 | } |
| 471 | |
| 472 | /** |
| 473 | * The whole document: what the index expects, what a recording holds, and where |