UNPKG

366 BTypeScriptView Raw
1/**
2 * Checks if a regex is safe to use in order to prevent catastrophic backtracking.
3 * @param re can be a RegExp object or just a string.
4 * @param opts Options for the check.
5 * `limit` - maximum number of allowed repetitions in the entire regex. Default: `25`.
6 */
7declare function safe(re: string | RegExp, opts?: { limit?: number }): boolean;
8
9export = safe;