MCPcopy
hub / github.com/microsoft/playwright-mcp / updateSection

Function updateSection

update-readme.js:105–118  ·  view source on GitHub ↗

* @param {string} content * @param {string} startMarker * @param {string} endMarker * @param {string[]} generatedLines * @returns {Promise }

(content, startMarker, endMarker, generatedLines)

Source from the content-addressed store, hash-verified

103 * @returns {Promise<string>}
104 */
105async function updateSection(content, startMarker, endMarker, generatedLines) {
106 const startMarkerIndex = content.indexOf(startMarker);
107 const endMarkerIndex = content.indexOf(endMarker);
108 if (startMarkerIndex === -1 || endMarkerIndex === -1)
109 throw new Error('Markers for generated section not found in README');
110
111 return [
112 content.slice(0, startMarkerIndex + startMarker.length),
113 '',
114 generatedLines.join('\n'),
115 '',
116 content.slice(endMarkerIndex),
117 ].join('\n');
118}
119
120/**
121 * @param {string} content

Callers 3

updateToolsFunction · 0.85
updateOptionsFunction · 0.85
updateConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected