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

Function compareHref

apps/reader/src/models/reader.ts:23–36  ·  view source on GitHub ↗
(
  sectionHref: string | undefined,
  navitemHref: string | undefined,
)

Source from the content-addressed store, hash-verified

21}
22
23export function compareHref(
24 sectionHref: string | undefined,
25 navitemHref: string | undefined,
26) {
27 if (sectionHref && navitemHref) {
28 const [target] = navitemHref.split('#')
29
30 return (
31 sectionHref.endsWith(target!) ||
32 // fix for relative nav path `../Text/example.html`
33 target?.endsWith(sectionHref)
34 )
35 }
36}
37
38function compareDefinition(d1: string, d2: string) {
39 return d1.toLowerCase() === d2.toLowerCase()

Callers 3

FindMatchesFunction · 0.90
TocRowFunction · 0.90
mapSectionToNavItemMethod · 0.85

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected