summaryrefslogtreecommitdiff
path: root/source/github-helpers/api.ts
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2021-07-08 19:31:59 +0700
committerGravatar GitHub <noreply@github.com> 2021-07-08 19:31:59 +0700
commitf908677216e84f4a238a69f0573a257945ea6a25 (patch)
tree62e5c6a111db006fb1afccc0889169cd1dce6d2b /source/github-helpers/api.ts
parent0830ef295133f99d66727c85af4bef1f252c1461 (diff)
downloadrefined-github-f908677216e84f4a238a69f0573a257945ea6a25.tar.gz
refined-github-f908677216e84f4a238a69f0573a257945ea6a25.tar.zst
refined-github-f908677216e84f4a238a69f0573a257945ea6a25.zip
Lint (#4544)
Diffstat (limited to 'source/github-helpers/api.ts')
-rw-r--r--source/github-helpers/api.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/source/github-helpers/api.ts b/source/github-helpers/api.ts
index 0c0abc64..386156ac 100644
--- a/source/github-helpers/api.ts
+++ b/source/github-helpers/api.ts
@@ -75,13 +75,13 @@ export async function expectTokenScope(scope: string): Promise<void> {
}
}
-const api3 = pageDetect.isEnterprise() ?
- `${location.origin}/api/v3/` :
- 'https://api.github.com/';
+const api3 = pageDetect.isEnterprise()
+ ? `${location.origin}/api/v3/`
+ : 'https://api.github.com/';
-const api4 = pageDetect.isEnterprise() ?
- `${location.origin}/api/graphql` :
- 'https://api.github.com/graphql';
+const api4 = pageDetect.isEnterprise()
+ ? `${location.origin}/api/graphql`
+ : 'https://api.github.com/graphql';
interface GHRestApiOptions {
ignoreHTTPStatus?: boolean;
@@ -209,9 +209,9 @@ export async function getError(apiResponse: JsonObject): Promise<RefinedGitHubAP
if ((apiResponse.message as string)?.includes('API rate limit exceeded')) {
return new RefinedGitHubAPIError(
'Rate limit exceeded.',
- personalToken ?
- 'It may be time for a walk! 🍃 🌞' :
- 'Set your token in the options or take a walk! 🍃 🌞',
+ personalToken
+ ? 'It may be time for a walk! 🍃 🌞'
+ : 'Set your token in the options or take a walk! 🍃 🌞',
);
}
@@ -223,9 +223,9 @@ export async function getError(apiResponse: JsonObject): Promise<RefinedGitHubAP
const error = new RefinedGitHubAPIError(
'Unable to fetch.',
- personalToken ?
- 'Ensure that your token has access to this repo.' :
- 'Maybe adding a token in the options will fix this issue.',
+ personalToken
+ ? 'Ensure that your token has access to this repo.'
+ : 'Maybe adding a token in the options will fix this issue.',
JSON.stringify(apiResponse, null, '\t'), // Beautify
);
error.response = apiResponse;