MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / blank

Function blank

src/extraction/languages/c-cpp.ts:779–790  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

777 if (spans.length === 0) return source;
778 const ordered = [...spans].sort((a, b) => a[0] - b[0]);
779 const blank = (text: string): string => {
780 let out = '';
781 let at = 0;
782 for (const [start, end] of ordered) {
783 const from = Math.max(start, at);
784 if (from >= end) continue;
785 const span = text.slice(from, end);
786 out += text.slice(at, from) + (span.includes('\n') || span.includes('\r') ? span.replace(/[^\r\n]/g, ' ') : ' '.repeat(span.length));
787 at = end;
788 }
789 return out + text.slice(at);
790 };
791 const out = blank(source);
792 if (code !== undefined) cppMaskMemo = { source: out, code: blank(code) };
793 return out;

Callers 4

blankCppSpansFunction · 0.70
blankLineFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected