@@ -65,13 +65,22 @@ export function generateGitHubWebUrl(
65
65
return newUrl + comment ;
66
66
}
67
67
68
- const addHours = ( date : string , hours : number ) =>
69
- new Date ( new Date ( date ) . getTime ( ) + hours * 36e5 ) . toISOString ( ) ;
68
+ export function addHours ( date : string , hours : number ) : string {
69
+ return new Date ( new Date ( date ) . getTime ( ) + hours * 36e5 ) . toISOString ( ) ;
70
+ }
70
71
71
- const queryString = ( repo : string , title : string , lastUpdated : string ) =>
72
- `${ title } in:title repo:${ repo } updated:>${ addHours ( lastUpdated , - 2 ) } ` ;
72
+ export function formatSearchQueryString (
73
+ repo : string ,
74
+ title : string ,
75
+ lastUpdated : string ,
76
+ ) : string {
77
+ return `${ title } in:title repo:${ repo } updated:>${ addHours ( lastUpdated , - 2 ) } ` ;
78
+ }
73
79
74
- async function getReleaseTagWebUrl ( notification : Notification , token : string ) {
80
+ export async function getReleaseTagWebUrl (
81
+ notification : Notification ,
82
+ token : string ,
83
+ ) {
75
84
const response = await apiRequestAuth ( notification . subject . url , 'GET' , token ) ;
76
85
77
86
return {
@@ -89,7 +98,7 @@ async function getDiscussionUrl(
89
98
token ,
90
99
{
91
100
query : `{
92
- search(query:"${ queryString (
101
+ search(query:"${ formatSearchQueryString (
93
102
notification . repository . full_name ,
94
103
notification . subject . title ,
95
104
notification . updated_at ,
0 commit comments