diff --git a/src/lib/utils/sort.ts b/src/lib/utils/sort.ts index 5b5cc3e34..476fb65fd 100644 --- a/src/lib/utils/sort.ts +++ b/src/lib/utils/sort.ts @@ -19,7 +19,7 @@ export const SORT_STRATEGIES = [ "visibility", "required-first", "kind", - "internal-first", + "external-last", ] as const; export type SortStrategy = (typeof SORT_STRATEGIES)[number]; @@ -152,7 +152,7 @@ const sorts: Record< kind(a, b, { kindSortOrder }) { return kindSortOrder.indexOf(a.kind) < kindSortOrder.indexOf(b.kind); }, - "internal-first"(a, b) { + "external-last"(a, b) { return !a.flags.isExternal && b.flags.isExternal; }, }; diff --git a/src/test/utils/sort.test.ts b/src/test/utils/sort.test.ts index 487eac383..2c1fd49b8 100644 --- a/src/test/utils/sort.test.ts +++ b/src/test/utils/sort.test.ts @@ -209,7 +209,7 @@ describe("Sort", () => { ); }); - it("Should sort by internal first", () => { + it("Should sort by external last", () => { const arr = [ new DeclarationReflection("a", ReflectionKind.Function), new DeclarationReflection("b", ReflectionKind.Function), @@ -219,7 +219,7 @@ describe("Sort", () => { arr[1].setFlag(ReflectionFlag.External, false); arr[2].setFlag(ReflectionFlag.External, true); - sortReflections(arr, ["internal-first"]); + sortReflections(arr, ["external-last"]); equal( arr.map((r) => r.name), ["b", "a", "c"],