MCPcopy Create free account
hub / github.com/arktypeio/arktype / homeSectionOf

Function homeSectionOf

ark/docs/components/shell/SearchPanel.tsx:152–155  ·  view source on GitHub ↗
({ index }: Loaded)

Source from the content-addressed store, hash-verified

150
151/** the section of the page being read, or ArkType's outside the docs */
152const homeSectionOf = ({ index }: Loaded) => {
153 const path = withoutBase(location.pathname).replace(/\/$/, "")
154 return index.pages.find(page => page.url === path)?.section ?? 0
155}
156
157type Hit = {
158 key: string

Callers 1

resultsOfFunction · 0.85

Calls 3

withoutBaseFunction · 0.90
replaceMethod · 0.80
findMethod · 0.80

Tested by

no test coverage detected