/** * Blank comment bodies while preserving every byte offset. * * An extractor that wants to ignore comments but still report true line numbers needs * BLANKING (replace with spaces) rather than stripping, so an index into the result is * an index into the original. It also needs to be STRING-AWARE, which is the part a * regex cannot do: `app.use('/static/*', …)` is a glob route, not the start of a block * comment, and treating it as one silently erases everything up to the next block-comment terminator — * typically the file's next JSDoc, and with it the file's entire middleware inventory. * * So this is a single-pass character scanner, modeled on `stripComments` in * duplicate-detector.ts (same string/escape handling, same "unterminated runs to * end-of-input" degradation) but writing spaces instead of dropping characters. Being a * scanner rather than a regex also makes it linear by construction — no backtracking, * no quantifier to bound — where the regex form was quadratic until its own bound. * * KNOWN LIMIT, shared with the scanner it is modeled on: a regex literal containing * `/*` or `//` (e.g. `/ab\/*cd/`) is read as a comment opener. Distinguishing a regex * literal from division needs real parser context; the failure mode is over-blanking a * rare line, never mis-positioning one. */ /** * Return `text` with the contents of `//` and block comments replaced by spaces. * Newlines are preserved exactly, so `text.length`, every `\n` index, and therefore * every derived line number are identical to the input's. */ export declare function blankCommentsPreservingLayout(text: string): string; //# sourceMappingURL=comment-blanking.d.ts.map