summaryrefslogtreecommitdiff
path: root/source/github-helpers
diff options
context:
space:
mode:
Diffstat (limited to 'source/github-helpers')
-rw-r--r--source/github-helpers/index.test.ts12
-rw-r--r--source/github-helpers/index.ts4
2 files changed, 8 insertions, 8 deletions
diff --git a/source/github-helpers/index.test.ts b/source/github-helpers/index.test.ts
index 04bf91cb..4f1a9d08 100644
--- a/source/github-helpers/index.test.ts
+++ b/source/github-helpers/index.test.ts
@@ -9,7 +9,7 @@ import {
} from '.';
test('getConversationNumber', () => {
- const pairs = new Map<string, string | undefined>([
+ const pairs = new Map<string, number | undefined>([
[
'https://github.com',
undefined,
@@ -48,23 +48,23 @@ test('getConversationNumber', () => {
],
[
'https://github.com/refined-github/refined-github/pull/148/commits/0019603b83bd97c2f7ef240969f49e6126c5ec85',
- '148',
+ 148,
],
[
'https://github.com/refined-github/refined-github/pull/148/commits/00196',
- '148',
+ 148,
],
[
'https://github.com/refined-github/refined-github/pull/148/commits',
- '148',
+ 148,
],
[
'https://github.com/refined-github/refined-github/pull/148',
- '148',
+ 148,
],
[
'https://github.com/refined-github/refined-github/issues/146',
- '146',
+ 146,
],
[
'https://github.com/refined-github/refined-github/issues',
diff --git a/source/github-helpers/index.ts b/source/github-helpers/index.ts
index 156fe18a..c42790a6 100644
--- a/source/github-helpers/index.ts
+++ b/source/github-helpers/index.ts
@@ -9,9 +9,9 @@ import * as pageDetect from 'github-url-detection';
export const getUsername = onetime(pageDetect.utils.getUsername);
export const {getRepositoryInfo: getRepo, getCleanPathname} = pageDetect.utils;
-export const getConversationNumber = (): string | undefined => {
+export const getConversationNumber = (): number | undefined => {
if (pageDetect.isPR() || pageDetect.isIssue()) {
- return location.pathname.split('/')[4];
+ return Number(location.pathname.split('/')[4]);
}
return undefined;