| 252 | }; |
| 253 | |
| 254 | const v3hasAnyItems = async ( |
| 255 | query: string, |
| 256 | options: GhRestApiOptions = {}, |
| 257 | ): Promise<boolean> => { |
| 258 | const url = new URL(query, api3); |
| 259 | url.searchParams.set('per_page', '1'); // Ensure we create pagination after 1 item |
| 260 | url.searchParams.set('page', '9999'); // Get an empty response |
| 261 | const {headers} = await v3(url.pathname + url.search, options); |
| 262 | |
| 263 | // If there's more than 1 item, we get a `Link` header |
| 264 | return headers.has('link'); |
| 265 | }; |
| 266 | |
| 267 | const v4uncached = async ( |
| 268 | query: string, |