Socket
Socket
Sign inDemoInstall

@putout/operator-regexp

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
4.9K
increased by4.39%
Maintainers
1
Install size
311 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 03 Oct 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc