npm.io
1.1.6 • Published 2 years ago

@types/safe-regex

Licence
MIT
Version
1.1.6
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
51.4K

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 1536 GMT
  • Dependencies: none

Credits

These definitions were written by Rodry.