Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit ae06254

Browse files
committed
Import compare directly
1 parent ec43806 commit ae06254

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/query/rest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Octokit } from '@octokit/core'
22
import { CheckFunction, CheckOptions, CheckResult, RestResponseTag } from '@version-checker/api'
33
import { compareReleases, compareTags } from '../util/comparator'
44
import { release, tag } from '../util/scheme-mapper'
5-
import semver from 'semver'
5+
import { compare } from 'semver'
66

77
/**
88
* Executes an API call on the Github Rest API (v3) that should return the latest version.
@@ -57,7 +57,7 @@ const rest: CheckFunction = async function(options: CheckOptions): Promise<Check
5757
// sort tags using semver.compare
5858
// in case the tag names are inconsistent (e.g. 1.0.0 => 2.0.0 => v3.0.0)
5959
const responseData = (response.data as Array<RestResponseTag>)
60-
.sort((a, b) => semver.compare(a.name, b.name))
60+
.sort((a, b) => compare(a.name, b.name))
6161
.reverse()
6262
result.update = tag(compareTags(options, responseData))
6363
}

0 commit comments

Comments
 (0)