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

refactor: Restrict `releaseTimestamp` type (#22971)

parent 11c05fc8
No related branches found
No related tags found
No related merge requests found
...@@ -70,15 +70,18 @@ export class JenkinsPluginsDatasource extends Datasource { ...@@ -70,15 +70,18 @@ export class JenkinsPluginsDatasource extends Datasource {
const versions: Record<string, Release[]> = {}; const versions: Record<string, Release[]> = {};
for (const name of Object.keys(plugins ?? [])) { for (const name of Object.keys(plugins ?? [])) {
versions[name] = Object.keys(plugins[name]).map((version) => ({ versions[name] = Object.keys(plugins[name]).map((version) => {
const downloadUrl = plugins[name][version]?.url;
const buildDate = plugins[name][version]?.buildDate;
const releaseTimestamp = buildDate
? new Date(`${buildDate} UTC`).toISOString()
: null;
return {
version, version,
downloadUrl: plugins[name][version]?.url, downloadUrl,
releaseTimestamp: plugins[name][version]?.buildDate releaseTimestamp,
? // TODO: types (#7154) };
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions });
new Date(`${plugins[name][version].buildDate} UTC`)
: null,
}));
} }
return versions; return versions;
} }
......
...@@ -46,7 +46,7 @@ export interface Release { ...@@ -46,7 +46,7 @@ export interface Release {
gitRef?: string; gitRef?: string;
isDeprecated?: boolean; isDeprecated?: boolean;
isStable?: boolean; isStable?: boolean;
releaseTimestamp?: any; releaseTimestamp?: string | null;
version: string; version: string;
newDigest?: string | undefined; newDigest?: string | undefined;
constraints?: Record<string, string[]>; constraints?: Record<string, string[]>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment