MCPcopy
hub / github.com/openclaw/clawsweeper / replaceFrontMatterValue

Function replaceFrontMatterValue

src/clawsweeper.ts:4819–4824  ·  view source on GitHub ↗
(markdown: string, key: string, value: string)

Source from the content-addressed store, hash-verified

4817}
4818
4819function replaceFrontMatterValue(markdown: string, key: string, value: string): string {
4820 const line = `${key}: ${value}`;
4821 const pattern = new RegExp(`^${key}:\\s*.*$`, "m");
4822 if (pattern.test(markdown)) return markdown.replace(pattern, line);
4823 return markdown.replace(/^---\n/, `---\n${line}\n`);
4824}
4825
4826function sectionValue(markdown: string, heading: string): string {
4827 const match = markdown.match(

Calls

no outgoing calls

Tested by

no test coverage detected