From c3424c52c4148f244ca9acaf22bdf3ea2c95f722 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Sun, 13 Nov 2022 20:19:06 -0600 Subject: [PATCH] chore: Clean up release sorting types --- src/functions.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/functions.ts b/src/functions.ts index 0e8adc8..fc5e803 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -10,7 +10,7 @@ const NEXTFLOW_REPO = {owner: 'nextflow-io', repo: 'nextflow'} // HACK Private but I want to test this export async function all_nf_releases( ok: InstanceType -): Promise { +): Promise { return await ok.paginate( ok.rest.repos.listReleases, NEXTFLOW_REPO, @@ -60,13 +60,13 @@ export async function release_data( } // Get all the releases - const all_releases = await all_nf_releases(ok) + const all_releases: object[] = await all_nf_releases(ok) - // FIXME Ignore const matching_releases = all_releases.filter(filter) - matching_releases.sort(function (x, y) { - semver.compare(x.tag_name, y.tag_name, true) + matching_releases.sort((x, y) => { + // HACK IDK why the value flip is necessary with the return + return semver.compare(x['tag_name'], y['tag_name'], true) * -1 }) return matching_releases[0]