New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/to-regex

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/to-regex

TypeScript definitions for to-regex

  • 3.0.4
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.8K
increased by4.36%
Maintainers
0
Weekly downloads
 
Created
Source

Installation

npm install --save @types/to-regex

Summary

This package contains type definitions for to-regex (https://github.com/jonschlinkert/to-regex).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/to-regex.

index.d.ts

declare namespace toRegex {
    interface Options {
        /**
         * Generate a regex that will match any string that contains the given
         * pattern. By default, regex is strict will only return true for
         * exact matches.
         */
        contains?: boolean;

        /**
         * Create a regex that will match everything except the given pattern.
         */
        negate?: boolean;

        /**
         * Adds the i flag, to enable case-insensitive matching.
         */
        nocase?: boolean;

        /**
         * Define the flags you want to use on the generated regex.
         */
        flags?: string;

        /**
         * Generated regex is cached based on the provided string and options.
         * As a result, runtime compilation only happens once per pattern (as
         * long as options are also the same), which can result in dramatic
         * speed improvements.
         *
         * This also helps with debugging, since adding options and pattern
         * are added to the generated regex.
         * @default true
         */
        cache?: boolean;

        /**
         * Check the generated regular expression with safe-regex and throw an
         * error if the regex is potentially unsafe.
         */
        safe?: boolean;
    }

    /**
     * Create a regular expression from the given `pattern` string.
     */
    function makeRe(pattern: string | RegExp, options?: Options): RegExp;
}

/**
 * Create a regular expression from the given `patterns` string.
 */
declare function toRegex(patterns: string | readonly string[] | RegExp, options?: toRegex.Options): RegExp;

export = toRegex;

Additional Details

  • Last updated: Fri, 23 Aug 2024 18:08:51 GMT
  • Dependencies: none

Credits

These definitions were written by Rauli Laine.

FAQs

Package last updated on 23 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc