File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -286,19 +286,24 @@ TEST: addTests('isQuickPR', [
286286 'https://github.com/sindresorhus/refined-github/compare/test-branch?quick_pull=1' ,
287287] ) ;
288288
289- export const isDraftPR = ( ) : boolean => ( $ ( '.State' ) ?? $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) === 'Draft' ;
289+ const prStateSelector = [
290+ '.State' ,
291+ '[class^="StateLabel"]' ,
292+ ] . join ( ',' ) ;
293+
294+ export const isDraftPR = ( ) : boolean => $ ( prStateSelector ) ! . textContent ! . trim ( ) === 'Draft' ;
290295export const isOpenPR = ( ) : boolean => {
291- const status = ( $ ( '.State' ) ?? $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) ;
296+ const status = $ ( prStateSelector ) ! . textContent ! . trim ( ) ;
292297 return status === 'Open' || status === 'Draft' ;
293298} ;
294299
295300export const isMergedPR = ( ) : boolean => {
296- const status = ( $ ( '.State' ) ?? $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) ;
301+ const status = $ ( prStateSelector ) ! . textContent ! . trim ( ) ;
297302 return status === 'Merged' ;
298303} ;
299304
300305export const isClosedPR = ( ) : boolean => {
301- const status = ( $ ( '.State' ) ?? $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) ;
306+ const status = $ ( prStateSelector ) ! . textContent ! . trim ( ) ;
302307 return status === 'Closed' || status === 'Merged' ;
303308} ;
304309
You can’t perform that action at this time.
0 commit comments