@@ -65,13 +65,22 @@ export function generateGitHubWebUrl(
6565 return newUrl + comment ;
6666}
6767
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+ }
7071
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+ }
7379
74- async function getReleaseTagWebUrl ( notification : Notification , token : string ) {
80+ export async function getReleaseTagWebUrl (
81+ notification : Notification ,
82+ token : string ,
83+ ) {
7584 const response = await apiRequestAuth ( notification . subject . url , 'GET' , token ) ;
7685
7786 return {
@@ -89,7 +98,7 @@ async function getDiscussionUrl(
8998 token ,
9099 {
91100 query : `{
92- search(query:"${ queryString (
101+ search(query:"${ formatSearchQueryString (
93102 notification . repository . full_name ,
94103 notification . subject . title ,
95104 notification . updated_at ,
0 commit comments