@types/safe-regex
TypeScript icon, indicating that this package has built-in type declarations

1.1.6 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @types/safe-regex

      Weekly Downloads

      31,707

      Version

      1.1.6

      License

      MIT

      Unpacked Size

      3.26 kB

      Total Files

      5

      Last publish

      Collaborators

      • types