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

Method requestAllPages

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

Source from the content-addressed store, hash-verified

370 }
371
372 async requestAllPages<T>(url: string, options: Options = {}) {
373 options = { cache: 'no-cache', ...options };
374 const headers = await this.requestHeaders(options.headers || {});
375 const processedURL = this.urlFor(url, options);
376 const allResponses = await getAllResponses(
377 processedURL,
378 { ...options, headers },
379 'next',
380 this.nextUrlProcessor(),
381 );
382 const pages: T[][] = await Promise.all(
383 allResponses.map((res: Response) => this.parseResponse(res)),
384 );
385 return ([] as T[]).concat(...pages);
386 }
387
388 generateContentKey(collectionName: string, slug: string) {
389 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