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

Function redirectSearch

components/Search.tsx:19–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 const upToMediumViewport = useBreakpoint('medium')
18
19 function redirectSearch() {
20 let asPath = `/${router.locale}`
21 if (currentVersion !== DEFAULT_VERSION) {
22 asPath += `/${currentVersion}`
23 }
24 asPath += '/search'
25 const params = new URLSearchParams({ query: localQuery })
26 if (debug) {
27 params.set('debug', '1')
28 }
29 asPath += `?${params}`
30 router.push(asPath)
31 }
32
33 return (
34 <div data-testid="search">

Callers 1

SearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected