(text: string)
| 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; |
no outgoing calls
no test coverage detected