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.
15 lines (14 loc) • 467 B
TypeScript
export type Entry<T> = Readonly<{
left: T;
right: T;
}>;
export declare class InfiniteLoopTracker<T> {
private readonly _history;
private _isEntryEqual;
private readonly _isEqual;
append(entry: Entry<T>): void;
clone(): InfiniteLoopTracker<T>;
constructor(isEqual: (left: T, right: T) => boolean, source?: InfiniteLoopTracker<T>);
getHistory(): ReadonlyArray<Entry<T>>;
getRepeatingEntries(): ReadonlyArray<Entry<T>> | null;
}