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

Method requestAllPages

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

Source from the content-addressed store, hash-verified

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