use @actions/github
This commit is contained in:
parent
9da537eb33
commit
0086c2ecdb
199 changed files with 95598 additions and 6141 deletions
24
node_modules/@octokit/plugin-paginate-rest/dist-src/paginate.js
generated
vendored
24
node_modules/@octokit/plugin-paginate-rest/dist-src/paginate.js
generated
vendored
|
|
@ -1,24 +0,0 @@
|
|||
import { iterator } from "./iterator";
|
||||
export function paginate(octokit, route, parameters, mapFn) {
|
||||
if (typeof parameters === "function") {
|
||||
mapFn = parameters;
|
||||
parameters = undefined;
|
||||
}
|
||||
return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
|
||||
}
|
||||
function gather(octokit, results, iterator, mapFn) {
|
||||
return iterator.next().then(result => {
|
||||
if (result.done) {
|
||||
return results;
|
||||
}
|
||||
let earlyExit = false;
|
||||
function done() {
|
||||
earlyExit = true;
|
||||
}
|
||||
results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
|
||||
if (earlyExit) {
|
||||
return results;
|
||||
}
|
||||
return gather(octokit, results, iterator, mapFn);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue