MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / replaceMarkerBlock

Function replaceMarkerBlock

packages/shared/src/editmode.ts:67–75  ·  view source on GitHub ↗
(
  source: string,
  kind: 'EDITMODE' | 'TWEAK-SCHEMA',
  replacement: string,
)

Source from the content-addressed store, hash-verified

65}
66
67function replaceMarkerBlock(
68 source: string,
69 kind: 'EDITMODE' | 'TWEAK-SCHEMA',
70 replacement: string,
71): string {
72 const block = findMarkerBlock(source, kind);
73 if (block === null) return source;
74 return `${source.slice(0, block.start)}/*${kind}-BEGIN*/${replacement}/*${kind}-END*/${source.slice(block.end)}`;
75}
76
77export interface EditmodeBlock {
78 tokens: EditmodeTokens;

Callers 3

replaceEditmodeBlockFunction · 0.85
replaceTweakSchemaFunction · 0.85

Calls 1

findMarkerBlockFunction · 0.85

Tested by

no test coverage detected