
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@types/to-regex
Advanced tools
npm install --save @types/to-regex
This package contains type definitions for to-regex (https://github.com/jonschlinkert/to-regex).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/to-regex.
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 | ReadonlyArray<string> | RegExp, options?: toRegex.Options): RegExp;
export = toRegex;
These definitions were written by Rauli Laine, and Anatoly Pitikin.
FAQs
TypeScript definitions for to-regex
The npm package @types/to-regex receives a total of 2,639 weekly downloads. As such, @types/to-regex popularity was classified as popular.
We found that @types/to-regex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.