/** * Strips `//` line comments and `/* *\/` block comments from JavaScript / * TypeScript source code, while preserving the verbatim content of: * * - single-quoted strings (`'...'`) * - double-quoted strings (`"..."`) * - template literals (`` `...` ``), including nested `${ ... }` * interpolations which may themselves contain strings or further templates * * Newlines are preserved so that downstream consumers that care about * line/column information (e.g. source-map-adjacent tooling) keep stable * offsets. Block-comment bodies are replaced with the newlines they * contained; line-comment bodies are removed up to (but not including) the * terminating newline. * * Implementation is an in-house state-machine scanner — preferred over a * dependency because the algorithm is small, deterministic, and avoids * surprises around nested template interpolations. * * @param code - JS/TS source to scrub * @returns the same source with comments removed and strings preserved */ declare function stripComments(code: string): string; export { stripComments };