Skip to content

Commit f3405fc

Browse files
committed
fixup! Add new discussions url to isDiscussion()
1 parent a31e4a8 commit f3405fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ addTests('isProjects', [
207207
'https://github.com/sindresorhus/refined-github/projects',
208208
]);
209209

210-
export const isDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => /^discussions\/\d+/.test(getRepo(url)?.path ?? getOrg(url)?.path!) || getRepo(url)?.path === 'discussions/new';
210+
export const isDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => /^discussions\/(\d+|new)/.test(getRepo(url)?.path ?? getOrg(url)?.path!);
211211
addTests('isDiscussion', [
212212
'https://github.com/tophf/mpiv/discussions/50',
213213
'https://github.com/orgs/community/discussions/11202',

0 commit comments

Comments
 (0)