(dfnsDocs, anchors = {})
| 603 | * @returns {{types:object,commands:object,events:object,domains:object}} |
| 604 | */ |
| 605 | export function buildSpecLinks(dfnsDocs, anchors = {}) { |
| 606 | const types = {} |
| 607 | for (const [name, href] of Object.entries(buildSpecHrefs(dfnsDocs))) types[name.toLowerCase()] = href |
| 608 | Object.assign(types, anchors.types ?? {}) // the prose section wins over the CDDL production |
| 609 | return { |
| 610 | types, |
| 611 | commands: { ...(anchors.commands ?? {}) }, |
| 612 | events: { ...(anchors.events ?? {}) }, |
| 613 | domains: { ...(anchors.modules ?? {}) }, |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | // Every type name a *type expression* references (the value of a `field.type`, or a |
| 618 | // list element / map value type), descending through list, map, inline union arms, and |
no test coverage detected