MCPcopy Index your code
hub / github.com/github/docs / useQuery

Function useQuery

components/hooks/useQuery.ts:7–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5 debug: boolean
6}
7export const useQuery = (): QueryInfo => {
8 const router = useRouter()
9 const query =
10 router.query.query && Array.isArray(router.query.query)
11 ? router.query.query[0]
12 : router.query.query || ''
13
14 const debug = parseDebug(router.query.debug)
15
16 return {
17 query,
18 debug,
19 }
20}
21
22function parseDebug(debug: string | Array<string> | undefined) {
23 if (debug === '') {

Callers 3

SearchFunction · 0.90
SearchResultHitsFunction · 0.90
SearchFunction · 0.90

Calls 1

parseDebugFunction · 0.85

Tested by

no test coverage detected