Skip to content

Commit fdd6a4c

Browse files
authored
Add isNewFile (#70)
1 parent 9aa429d commit fdd6a4c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ collect.set('isMilestoneList', [
127127
'https://github.com/sindresorhus/refined-github/milestones',
128128
]);
129129

130+
export const isNewFile = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('new'));
131+
collect.set('isNewFile', [
132+
'https://github.com/sindresorhus/refined-github/new/main',
133+
]);
134+
130135
export const isNewIssue = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'issues/new';
131136
collect.set('isNewIssue', [
132137
'https://github.com/sindresorhus/refined-github/issues/new',

0 commit comments

Comments
 (0)