redos-detector
Version:
A CLI and library which tests helps score how vulnerable a regex pattern is to ReDoS attacks. Supported in the browser, Node and Deno.
12 lines (11 loc) • 486 B
TypeScript
import { OurRange } from './our-range';
export type CharacterGroups = Readonly<{
rangesNegated: boolean;
ranges: readonly OurRange[];
unicodePropertyEscapes: ReadonlyMap<string, boolean>;
}>;
/**
* Returns `true` if the provided `CharacterGroups` definitely matches no characters.
*/
export declare function isEmptyCharacterGroups(group: CharacterGroups): boolean;
export declare function intersectCharacterGroups(a: CharacterGroups, b: CharacterGroups): CharacterGroups;