MCPcopy Index your code
hub / github.com/refined-github/refined-github / v3hasAnyItems

Function v3hasAnyItems

source/github-helpers/api.tsx:254–265  ·  view source on GitHub ↗
(
	query: string,
	options: GhRestApiOptions = {},
)

Source from the content-addressed store, hash-verified

252};
253
254const 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
267const v4uncached = async (
268 query: string,

Callers

nothing calls this directly

Calls 1

setMethod · 0.80

Tested by

no test coverage detected