/** * Sanitizer coverage helper — H8 (#254 3.171.0). * * `TaintSanitizer.sanitizes` is a `SinkType[]` (typically 1–3 entries but * up to ~12 for wide-coverage sanitizers). Ten hot sites across * taint-propagation, sink-filter, interprocedural, and cross-file passes * call `san.sanitizes.includes(sinkType)` inside inner loops that iterate * over (sanitizers × sinks × taint checks). On the 500-file langchain4j * benchmark that shape accounts for ~6–10% of taint-propagation pass time * because `.includes()` is O(n) linear scan. * * This helper builds and caches a `Set` per sanitizer via a * WeakMap. Cache lifetime tracks the sanitizer object itself: no manual * invalidation, no memory leak, no API-surface change on `TaintSanitizer`. * * The `Set` is intentionally typed on `string` (not `SinkType`) so * callers that stringify the sink type (`f.sink_type: string`) don't need * a cast — matches the shape of the sites already using * `(san.sanitizes as readonly string[]).includes(f.sink_type)`. */ import type { TaintSanitizer } from '../types/index.js'; /** * True when the sanitizer covers the given sink type. O(1) after first * call for each sanitizer object (Set-backed lookup vs the prior * `Array.prototype.includes` linear scan). */ export declare function sanitizerCoversSink(san: TaintSanitizer, sinkType: string): boolean; /** * True when the sanitizer covers at least one sink type. Useful for the * "unknown/source sinkType — accept any recognised sanitizer" branch in * `checkSanitized` (propagation-context sanitizer check). */ export declare function sanitizerCoversAny(san: TaintSanitizer): boolean; //# sourceMappingURL=sanitizer-index.d.ts.map