invert to a guard clause

Co-authored-by: Kevin Stillhammer <kevin.stillhammer@gmail.com>
This commit is contained in:
pollenjp 2024-11-30 09:38:56 +09:00
parent 40f8c3a1cf
commit c897c56b99

View file

@ -9,8 +9,8 @@ export async function getLatestVersion(githubToken: string) {
repo: REPO, repo: REPO,
}); });
if (latestRelease) { if (!latestRelease) {
return latestRelease.tag_name; throw new Error("Could not determine latest release.");
} }
throw new Error("Could not determine latest release."); return latestRelease.tag_name;
} }