Skip to content

Commit

Permalink
Rename internal-first sort strategy to external-last
Browse files Browse the repository at this point in the history
  • Loading branch information
rsanchez authored and Gerrit0 committed Oct 28, 2023
1 parent 02a14c0 commit 325233c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/utils/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
},
};
Expand Down
4 changes: 2 additions & 2 deletions src/test/utils/sort.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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"],
Expand Down

0 comments on commit 325233c

Please sign in to comment.