MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getValue

Function getValue

sdk/src/tools/read-url.ts:234–243  ·  view source on GitHub ↗
(key: 'title' | 'description')

Source from the content-addressed store, hash-verified

232
233 const frontmatter = match[1]
234 const getValue = (key: 'title' | 'description') => {
235 const valueMatch = frontmatter.match(
236 new RegExp(`^${key}:\\s*(?:"([^"]*)"|'([^']*)'|(.+))\\s*$`, 'm'),
237 )
238 return normalizeText(
239 decodeHtmlEntities(
240 valueMatch?.[1] ?? valueMatch?.[2] ?? valueMatch?.[3] ?? '',
241 ),
242 )
243 }
244
245 return {
246 title: getValue('title') || undefined,

Callers 1

Calls 2

normalizeTextFunction · 0.85
decodeHtmlEntitiesFunction · 0.85

Tested by

no test coverage detected