MCPcopy Create free account
hub / github.com/emwalker/digraph / pathnameFor

Function pathnameFor

client/src/components/ui/SearchBox/index.tsx:16–19  ·  view source on GitHub ↗
(pathname: string, selectedScope: string)

Source from the content-addressed store, hash-verified

14const atHomepage = (pathname: string) => pathname === '/'
15
16const pathnameFor = (pathname: string, selectedScope: string) => {
17 if (atHomepage(pathname)) return topicPath(everythingTopicId)
18 return selectedScope === 'Everything' ? topicPath(everythingTopicId) : pathname
19}
20
21const onFormSubmit = (event: FormEvent<HTMLFormElement>) => {
22 event.preventDefault()

Callers 1

SearchBoxFunction · 0.85

Calls 2

topicPathFunction · 0.90
atHomepageFunction · 0.85

Tested by

no test coverage detected