Package Exports
- @putout/operator-regexp
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@putout/operator-regexp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@putout/operator-regexp

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