(dfnsDocs, anchors = {})
| 529 | * @returns {{types:object,commands:object,events:object,domains:object}} |
| 530 | */ |
| 531 | export function buildSpecLinks(dfnsDocs, anchors = {}) { |
| 532 | const types = {} |
| 533 | for (const [name, href] of Object.entries(buildSpecHrefs(dfnsDocs))) types[name.toLowerCase()] = href |
| 534 | Object.assign(types, anchors.types ?? {}) // the prose section wins over the CDDL production |
| 535 | return { |
| 536 | types, |
| 537 | commands: { ...(anchors.commands ?? {}) }, |
| 538 | events: { ...(anchors.events ?? {}) }, |
| 539 | domains: { ...(anchors.modules ?? {}) }, |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | // Every type name a *type expression* references (the value of a `field.type`, or a |
| 544 | // list element / map value type), descending through list, map, inline union arms, and |
no test coverage detected