MCPcopy Create free account
hub / github.com/decaporg/decap-cms / requestAllPages

Method requestAllPages

packages/decap-cms-backend-github/src/API.ts:397–411  ·  view source on GitHub ↗
(url: string, options: Options = {})

Source from the content-addressed store, hash-verified

395 }
396
397 async requestAllPages<T>(url: string, options: Options = {}) {
398 options = { cache: 'no-cache', ...options };
399 const headers = await this.requestHeaders(options.headers || {});
400 const processedURL = this.urlFor(url, options);
401 const allResponses = await getAllResponses(
402 processedURL,
403 { ...options, headers },
404 'next',
405 this.nextUrlProcessor(),
406 );
407 const pages: T[][] = await Promise.all(
408 allResponses.map((res: Response) => this.parseResponse(res)),
409 );
410 return ([] as T[]).concat(...pages);
411 }
412
413 generateContentKey(collectionName: string, slug: string) {
414 const contentKey = generateContentKey(collectionName, slug);

Callers 1

getPullRequestsMethod · 0.95

Calls 6

requestHeadersMethod · 0.95
urlForMethod · 0.95
nextUrlProcessorMethod · 0.95
parseResponseMethod · 0.95
getAllResponsesFunction · 0.90
mapMethod · 0.80

Tested by

no test coverage detected