MCPcopy
hub / github.com/leonhartX/gas-github / followPaginate

Method followPaginate

src/scm/github.js:490–509  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

488 }
489
490 followPaginate(data) {
491 return new Promise((resolve, reject) => {
492 getGitHubJSON(data.url, data.accessToken)
493 .then((response, status, xhr) => {
494 data.items = data.items.concat(response);
495 const link = xhr.getResponseHeader('Link');
496 let url = null;
497 if (link) {
498 const match = link.match(/.*<(.*?)>; rel="next"/);
499 url = match && match[1] ? match[1] : null;
500 }
501 resolve({
502 items: data.items,
503 url: url,
504 accessToken: data.accessToken
505 });
506 })
507 .fail(reject);
508 });
509 }
510}

Callers

nothing calls this directly

Calls 1

getGitHubJSONFunction · 0.85

Tested by

no test coverage detected