Skip to content

Commit 8094099

Browse files
committed
sort tags when getting the latest
1 parent a81022a commit 8094099

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/modules/gh-docs/.server/tags.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export async function getTags(repo: string) {
1111
}
1212

1313
export function getLatestVersion(tags: string[]) {
14-
return tags.filter((tag) =>
14+
let sortedTags = [...tags].sort(semver.rcompare);
15+
16+
return sortedTags.filter((tag) =>
1517
semver.satisfies(tag, "*", { includePrerelease: false }),
1618
)[0];
1719
}

0 commit comments

Comments
 (0)