Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
9c1a0dca
Unverified
Commit
9c1a0dca
authored
Jun 25, 2023
by
Sergei Zharinov
Committed by
GitHub
Jun 25, 2023
Browse files
Options
Downloads
Patches
Plain Diff
refactor: Restrict `releaseTimestamp` type (#22971)
parent
11c05fc8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/datasource/jenkins-plugins/index.ts
+12
-9
12 additions, 9 deletions
lib/modules/datasource/jenkins-plugins/index.ts
lib/modules/datasource/types.ts
+1
-1
1 addition, 1 deletion
lib/modules/datasource/types.ts
with
13 additions
and
10 deletions
lib/modules/datasource/jenkins-plugins/index.ts
+
12
−
9
View file @
9c1a0dca
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/modules/datasource/types.ts
+
1
−
1
View file @
9c1a0dca
...
@@ -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
[]
>
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment