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

Method requestAllValues

packages/decap-cms-backend-bitbucket/src/API.ts:243–254  ·  view source on GitHub ↗
(req: ApiRequest)

Source from the content-addressed store, hash-verified

241 // Bitbucket returns lists one page at a time. Follow the `next` links and
242 // return the values of every page.
243 async requestAllValues<T>(req: ApiRequest): Promise<T[]> {
244 let page: BitBucketPage<T> = await this.requestJSON(req);
245 const values = [...page.values];
246 // Stop if a `next` link repeats, so a bad link can't cause an endless loop
247 const requestedLinks = new Set<string>();
248 while (page.next && !requestedLinks.has(page.next)) {
249 requestedLinks.add(page.next);
250 page = await this.requestJSON(this.toRelativeLink(page.next));
251 values.push(...page.values);
252 }
253 return values;
254 }
255
256 user = () => this.requestJSON('/user') as Promise<BitBucketUser>;
257

Callers 2

api.spec.jsFile · 0.80

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected