Skip to content

Commit 24cfab2

Browse files
authored
Add isGistRevision (#115)
1 parent f92d888 commit 24cfab2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ collect.set('isGist', [
8989
'http://gist.github.com',
9090
'https://gist.github.com/sindresorhus/0ea3c2845718a0a0f0beb579ff14f064',
9191
'https://my-little-hub.com/gist',
92+
'https://gist.github.com/kidonng/0d16c7f17045f486751fad1b602204a0/revisions',
9293
]);
9394

9495
export const isGlobalConversationList = (url: URL | HTMLAnchorElement | Location = location): boolean => ['issues', 'pulls'].includes(url.pathname.split('/', 2)[1]!);
@@ -505,6 +506,11 @@ collect.set('isSingleGist', [
505506
'https://gist.github.com/sindresorhus/0ea3c2845718a0a0f0beb579ff14f064',
506507
]);
507508

509+
export const isGistRevision = (url: URL | HTMLAnchorElement | Location = location): boolean => isGist(url) && /^\/(gist\/)?[^/]+\/[\da-f]{32}\/revisions$/.test(url.pathname);
510+
collect.set('isGistRevision', [
511+
'https://gist.github.com/kidonng/0d16c7f17045f486751fad1b602204a0/revisions',
512+
]);
513+
508514
export const isTrending = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname === '/trending' || url.pathname.startsWith('/trending/');
509515
collect.set('isTrending', [
510516
'https://github.com/trending',

0 commit comments

Comments
 (0)