diff options
author | 2019-08-11 00:36:15 +0700 | |
---|---|---|
committer | 2019-08-11 00:36:15 +0700 | |
commit | e4aee10d755fb247d108caf55e45ac17d383c078 (patch) | |
tree | c3caaa959e8a64f326efcb9828e74795f9df4fa0 /source/libs/utils.ts | |
parent | 093afa195cb594494ead20b103e85963ce4cd1e0 (diff) | |
download | refined-github-e4aee10d755fb247d108caf55e45ac17d383c078.tar.gz refined-github-e4aee10d755fb247d108caf55e45ac17d383c078.tar.zst refined-github-e4aee10d755fb247d108caf55e45ac17d383c078.zip |
Meta: improve GQL API usage
And avoid `getOwnerAndRepo` whenever possible
Diffstat (limited to 'source/libs/utils.ts')
-rw-r--r-- | source/libs/utils.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/libs/utils.ts b/source/libs/utils.ts index c3e2bc90..1eed991b 100644 --- a/source/libs/utils.ts +++ b/source/libs/utils.ts @@ -49,6 +49,10 @@ export const getCurrentBranch = (): string => { }; export const getRepoURL = (): string => location.pathname.slice(1).split('/', 2).join('/'); +export const getRepoGQL = (): string => { + const {ownerName, repoName} = getOwnerAndRepo(); + return `owner: "${ownerName}", name: "${repoName}"`; +}; export const getOwnerAndRepo = (): { ownerName: string; |