MCPcopy Index your code
hub / github.com/awesome-opencode/awesome-opencode / replacePlaceholder

Function replacePlaceholder

scripts/utils/template.js:24–27  ·  view source on GitHub ↗

* Replace a placeholder in the template * @param {string} template - Template content * @param {string} placeholder - Placeholder name (without braces) * @param {string} content - Content to insert * @returns {string} Updated template

(template, placeholder, content)

Source from the content-addressed store, hash-verified

22 * @returns {string} Updated template
23 */
24function replacePlaceholder(template, placeholder, content) {
25 const pattern = new RegExp(`\\{\\{${placeholder}\\}\\}`, 'g');
26 return template.replace(pattern, content);
27}
28
29/**
30 * Generate HTML for a single entry

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected