summaryrefslogtreecommitdiff
path: root/source/github-helpers/api.ts
diff options
context:
space:
mode:
authorGravatar Federico <me@fregante.com> 2020-12-27 18:29:54 -0600
committerGravatar GitHub <noreply@github.com> 2020-12-27 18:29:54 -0600
commitcbb09111ff650f08f1d132142f65c4634626bd75 (patch)
treebd253c5a5d9e375075e318a4d5591662b6f1f022 /source/github-helpers/api.ts
parent30640fae7cdf6ea2eb8423834ef272cec7b4ed4d (diff)
downloadrefined-github-cbb09111ff650f08f1d132142f65c4634626bd75.tar.gz
refined-github-cbb09111ff650f08f1d132142f65c4634626bd75.tar.zst
refined-github-cbb09111ff650f08f1d132142f65c4634626bd75.zip
Update dependencies (#3850)
Diffstat (limited to 'source/github-helpers/api.ts')
-rw-r--r--source/github-helpers/api.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/github-helpers/api.ts b/source/github-helpers/api.ts
index 56efbea1..c2fa63eb 100644
--- a/source/github-helpers/api.ts
+++ b/source/github-helpers/api.ts
@@ -153,8 +153,10 @@ export const v3paginated = async function * (
const response = await v3(query, options);
yield response;
- [, query] = /<([^>]+)>; rel="next"/.exec(response.headers.get('link')!) ?? [];
- if (!query) {
+ const match = /<([^>]+)>; rel="next"/.exec(response.headers.get('link')!);
+ if (match) {
+ query = match[1]!;
+ } else {
return;
}
}