Commit ce2a393b authored by Robert Knight's avatar Robert Knight

fixup! - Use a clearer name for `iterateItems` function

parent b0403d0c
...@@ -30,9 +30,10 @@ function getLastTag() { ...@@ -30,9 +30,10 @@ function getLastTag() {
} }
/** /**
* Iterate over pages of items in a GitHub API response and yield each item. * Iterate over items in a GitHub API response and yield each item, fetching
* additional pages of results as necessary.
*/ */
async function* iterateItems(octokit, response) { async function* itemsInGitHubAPIResponse(octokit, response) {
let isFirstPage = true; let isFirstPage = true;
while (isFirstPage || octokit.hasNextPage(response)) { while (isFirstPage || octokit.hasNextPage(response)) {
isFirstPage = false; isFirstPage = false;
...@@ -58,7 +59,7 @@ async function getPRsMergedSince(octokit, org, repo, tag) { ...@@ -58,7 +59,7 @@ async function getPRsMergedSince(octokit, org, repo, tag) {
}); });
const prs = []; const prs = [];
for await (const pr of iterateItems(octokit, response)) { for await (const pr of itemsInGitHubAPIResponse(octokit, response)) {
if (!pr.merged_at) { if (!pr.merged_at) {
// This PR was closed without being merged. // This PR was closed without being merged.
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment