@types/safe-regex

  • Version 1.1.6
  • Published
  • 3.26 kB
  • No dependencies
  • MIT license

Install

npm i @types/safe-regex
yarn add @types/safe-regex
pnpm add @types/safe-regex

Overview

TypeScript definitions for safe-regex

Index

Functions

Functions

function safe

safe: (re: string | RegExp, opts?: { limit?: number }) => boolean;
  • Checks if a regex is safe to use in order to prevent catastrophic backtracking.

    Parameter re

    can be a RegExp object or just a string.

    Parameter opts

    Options for the check. limit - maximum number of allowed repetitions in the entire regex. Default: 25.

Package Files (1)

Dependencies (0)

No dependencies.

Dev Dependencies (0)

No dev dependencies.

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/safe-regex.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/safe-regex)
  • HTML
    <a href="https://www.jsdocs.io/package/@types/safe-regex"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>