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

@putout/operator-regexp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/operator-regexp

putout operator adds ability to check if provided regexp can be converted to string without loosing it's sense

1.0.0
latest
Source
npm
Version published
Weekly downloads
6.5K
-11.18%
Maintainers
1
Weekly downloads
 
Created
Source

@putout/operator-regexp NPM version Dependency Status

putout operator adds ability to determine is provided RegExp can be converted to String without loosing it's sence.

It is used for example in regexp/convert-replace-to-relace-all:

-'hello'.replace(/hello/g, 'world');
+'hello'.replaceAll('hello', 'world');

Install

npm i putout @putout/operator-regexp

API

isSimpleRegexp(regexp: RegExp)

const {operator} = require('putout');
const {isSimpleRegExp} = operator;

isSimpleRegExp(/hello world/);
// returns
true;

isSimpleRegExp(/^hello/);
// returns
false;

License

MIT

Keywords

putout

FAQs

Package last updated on 03 Oct 2021

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