/** * Blank everything in a source file that is not code, keeping module specifiers * (change: add-phantom-reference-findings). * * The import scanners in this codebase are regex passes over text. That is fine for building a call * graph, where a stray match costs a spurious edge, but the phantom-reference check turns a match * into a finding an agent is told to act on — so an `import` written inside a test fixture's * template literal, a documentation snippet, or a Python docstring must not be read as an import at * all. * * `sanitizeForRegex` almost does this, but it blanks every string body, and a module specifier IS a * string body: `import x from './y'` would lose `./y`. This mask keeps exactly the string bodies * that sit in specifier position — directly after `from`, `import(`, or `require(` — and blanks the * rest. Every character offset and line break is preserved, so the scanners' reported positions * still refer to the original text. * * It is one pass with no regex over the content, and every lookahead is bounded by a constant, so a * hostile file cannot make it quadratic. * * Deliberately NOT a parser: it recognizes comments, strings, template literals, and regex * literals, which is what it takes to tell code from text. JSX is not parsed; the rule that a * single- or double-quoted string cannot span a line (which is true in both JavaScript and Python) * is what keeps an apostrophe in JSX prose from swallowing the rest of the file. */ /** Which comment and string syntax a file uses. */ export type MaskFlavor = 'js' | 'python'; /** * `content` with comment, string, template, and regex bodies replaced by spaces — except a string * body in module-specifier position, which is kept verbatim. Same length, same line breaks. */ export declare function maskNonCode(content: string, flavor: MaskFlavor): string; /** The mask flavor for a language name, or null when the language is not masked. */ export declare function maskFlavorFor(language: string): MaskFlavor | null; //# sourceMappingURL=code-mask.d.ts.map