MCPcopy Create free account
hub / github.com/pacexy/flow / mapSectionToNavItem

Method mapSectionToNavItem

apps/reader/src/models/reader.ts:247–255  ·  view source on GitHub ↗
(sectionHref: string)

Source from the content-addressed store, hash-verified

245 }
246
247 mapSectionToNavItem(sectionHref: string) {
248 let navItem: NavItem | undefined
249 this.nav?.toc.forEach((item) =>
250 dfs(item as NavItem, (i) => {
251 if (compareHref(sectionHref, i.href)) navItem ??= i
252 }),
253 )
254 return navItem
255 }
256
257 get currentHref() {
258 return this.location?.start.href

Callers 2

renderMethod · 0.95
TimelineViewFunction · 0.80

Calls 3

dfsFunction · 0.90
compareHrefFunction · 0.85
forEachMethod · 0.45

Tested by

no test coverage detected