From b6c5801be4a50dca1c5be0e9ddd3944f2ed94778 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Fri, 9 Feb 2024 15:05:17 -0700 Subject: [PATCH] Fix duplicate programs on context --- CHANGELOG.md | 1 + src/lib/converter/converter.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5c90bc74..dfb312213 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - A class which implements itself will no longer cause a crash when rendering HTML, #2495. - Variable functions which have construct signatures will no longer be converted as functions, ignoring the construct signatures. - Fixed an issue where, if the index section was collapsed when loading the page, all content within it would be hidden until expanded, and a member visibility checkbox was changed. +- `Context.programs` will no longer contain duplicates, #2498. ## v0.25.7 (2024-01-08) diff --git a/src/lib/converter/converter.ts b/src/lib/converter/converter.ts index 445f3880c..08efaaeb9 100644 --- a/src/lib/converter/converter.ts +++ b/src/lib/converter/converter.ts @@ -13,7 +13,7 @@ import { import { Context } from "./context"; import { ConverterComponent } from "./components"; import { Component, ChildableComponent } from "../utils/component"; -import { Option, MinimalSourceFile, readFile } from "../utils"; +import { Option, MinimalSourceFile, readFile, unique } from "../utils"; import { convertType } from "./types"; import { ConverterEvents } from "./converter-events"; import { convertSymbol } from "./symbols"; @@ -222,7 +222,7 @@ export class Converter extends ChildableComponent< convert( entryPoints: readonly DocumentationEntryPoint[], ): ProjectReflection { - const programs = entryPoints.map((e) => e.program); + const programs = unique(entryPoints.map((e) => e.program)); this.externalPatternCache = void 0; const project = new ProjectReflection(