summaryrefslogtreecommitdiff
path: root/source/libs/utils.ts
diff options
context:
space:
mode:
authorGravatar Florian Reuschel <Florian.Reuschel@gmx.de> 2020-03-17 00:27:12 +0100
committerGravatar GitHub <noreply@github.com> 2020-03-17 00:27:12 +0100
commit47bae5f939d8ac4b3416749480aa5e85e0654c80 (patch)
tree343b4baa3e053689f1551455d99439b89b426f1b /source/libs/utils.ts
parentf2c0810be0629178c8aa08138ea47c7d79ee5f67 (diff)
downloadrefined-github-47bae5f939d8ac4b3416749480aa5e85e0654c80.tar.gz
refined-github-47bae5f939d8ac4b3416749480aa5e85e0654c80.tar.zst
refined-github-47bae5f939d8ac4b3416749480aa5e85e0654c80.zip
Add `show-open-prs-of-forks` feature (#2880)20.3.16
Co-authored-by: Federico Brigante <opensource@bfred.it>
Diffstat (limited to 'source/libs/utils.ts')
-rw-r--r--source/libs/utils.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/libs/utils.ts b/source/libs/utils.ts
index f7d5caaa..00009233 100644
--- a/source/libs/utils.ts
+++ b/source/libs/utils.ts
@@ -88,6 +88,10 @@ export const getOwnerAndRepo = (): {
return {ownerName, repoName};
};
+export function getForkedRepo(): string | undefined {
+ return select<HTMLAnchorElement>('.fork-flag a')?.pathname.slice(1);
+}
+
export const getReference = (): string | undefined => {
const pathnameParts = location.pathname.split('/');
if (['commits', 'blob', 'tree', 'blame'].includes(pathnameParts[3])) {