Installation
npm install --save @types/safe-regex
Summary
This package contains type definitions for safe-regex (https://github.com/davisjam/safe-regex).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/safe-regex.
index.d.ts
/**
* Checks if a regex is safe to use in order to prevent catastrophic backtracking.
* @param re can be a RegExp object or just a string.
* @param opts Options for the check.
* `limit` - maximum number of allowed repetitions in the entire regex. Default: `25`.
*/
declare function safe(re: string | RegExp, opts?: { limit?: number }): boolean;
export = safe;
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: none
Credits
These definitions were written by Rodry.