Skip to content

Commit 8f44f91

Browse files
Fix symbolic links in our documentation.
This fixes cross linking in type signatures etc. The bug was that reflected types now have a `target` property that links to the `id` of the original declaration.
1 parent 1ad52f3 commit 8f44f91

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/lit-dev-tools-cjs/src/api-docs/transformer.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export class ApiDocsTransformer {
413413
* TypeDoc has a reflection with that id, then we should give it a location.
414414
*/
415415
private addLocationsForAllIds(node: unknown, isTopLevel = true) {
416-
if (typeof node !== 'object' || node === null) {
416+
if (typeof node !== 'object' || node == null) {
417417
return;
418418
}
419419
if (node instanceof Array) {
@@ -423,7 +423,11 @@ export class ApiDocsTransformer {
423423
return;
424424
}
425425
for (const [key, val] of Object.entries(node)) {
426-
if (key === 'id' && typeof val === 'number' && !('location' in node)) {
426+
if (
427+
key === 'target' &&
428+
typeof val === 'number' &&
429+
!('location' in node)
430+
) {
427431
const reflection = this.reflectionById.get(val);
428432
if (reflection && reflection.location) {
429433
(node as {location?: Location}).location = reflection.location;

0 commit comments

Comments
 (0)