MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / titleCacheKey

Function titleCacheKey

ui-tui/src/lib/externalLink.ts:55–66  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

53}
54
55function titleCacheKey(value: string): string {
56 const url = parseUrl(value)
57
58 if (!url) {
59 return normalizeExternalUrl(value)
60 }
61
62 const host = url.hostname.replace(/^www\./i, '').toLowerCase()
63 const pathname = url.pathname === '/' ? '/' : url.pathname.replace(/\/+$/, '') || '/'
64
65 return `${host}${pathname}${url.search || ''}`
66}
67
68function cacheTitle(key: string, title: string): void {
69 if (titleCache.size >= TITLE_CACHE_LIMIT) {

Callers 2

fetchLinkTitleFunction · 0.85
useLinkTitleFunction · 0.85

Calls 2

parseUrlFunction · 0.85
normalizeExternalUrlFunction · 0.85

Tested by

no test coverage detected