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

Function blank

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

Source from the content-addressed store, hash-verified

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

Callers 4

blankCppSpansFunction · 0.70
blankLineFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected