Skip to content
Snippets Groups Projects
Unverified Commit 16c080fa authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

refactor(util): Fix unbound methods usage (#9626)

parent 0375422f
Branches
No related tags found
No related merge requests found
...@@ -72,11 +72,9 @@ async function getDockerTag( ...@@ -72,11 +72,9 @@ async function getDockerTag(
constraint: string, constraint: string,
scheme: string scheme: string
): Promise<string> { ): Promise<string> {
// TODO: fixme const ver = versioning.get(scheme);
// eslint-disable-next-line @typescript-eslint/unbound-method
const { isValid, isVersion, matches, sortVersions } = versioning.get(scheme);
if (!isValid(constraint)) { if (!ver.isValid(constraint)) {
logger.warn({ constraint }, `Invalid ${scheme} version constraint`); logger.warn({ constraint }, `Invalid ${scheme} version constraint`);
return 'latest'; return 'latest';
} }
...@@ -93,9 +91,9 @@ async function getDockerTag( ...@@ -93,9 +91,9 @@ async function getDockerTag(
if (imageReleases?.releases) { if (imageReleases?.releases) {
let versions = imageReleases.releases.map((release) => release.version); let versions = imageReleases.releases.map((release) => release.version);
versions = versions.filter( versions = versions.filter(
(version) => isVersion(version) && matches(version, constraint) (version) => ver.isVersion(version) && ver.matches(version, constraint)
); );
versions = versions.sort(sortVersions); versions = versions.sort(ver.sortVersions.bind(ver));
if (versions.length) { if (versions.length) {
const version = versions.pop(); const version = versions.pop();
logger.debug( logger.debug(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment