(source, ranges)
| 1010 | } |
| 1011 | |
| 1012 | function removeRanges(source, ranges) { |
| 1013 | let output = ""; |
| 1014 | let cursor = 0; |
| 1015 | for (const [start, end] of ranges.sort((a, b) => a[0] - b[0])) { |
| 1016 | output += source.slice(cursor, start); |
| 1017 | cursor = end; |
| 1018 | } |
| 1019 | output += source.slice(cursor); |
| 1020 | return output; |
| 1021 | } |
| 1022 | |
| 1023 | function sanitizePreviewSource(source, moduleName) { |
| 1024 | const stripped = source.replace( |