Skip to content

Commit d144e72

Browse files
committed
update
1 parent 02ee907 commit d144e72

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff 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';
290295
export 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

295300
export const isMergedPR = (): boolean => {
296-
const status = ($('.State') ?? $('[class^="StateLabel"]'))!.textContent!.trim();
301+
const status = $(prStateSelector)!.textContent!.trim();
297302
return status === 'Merged';
298303
};
299304

300305
export 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

0 commit comments

Comments
 (0)