{"name":"@putout/operator-regexp","version":"5.2.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout operator adds ability to check if provided regexp can be converted to string without losing it's sense","homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-regexp#readme","main":"lib/regexp.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"wisdom":"madrun wisdom","test":"madrun test","test:dts":"madrun test:dts","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{"jsesc":"^3.1.0","regexp-tree":"^0.1.24"},"keywords":["putout","putout-operator","operator","regexp"],"devDependencies":{"@putout/test":"^15.0.0","check-dts":"^1.0.0","eslint":"^10.0.0","eslint-plugin-putout":"^31.0.0","madrun":"^13.0.0","montag":"^2.0.0","nodemon":"^3.0.1","superc8":"^12.0.0","supertape":"^13.0.0","try-catch":"^4.0.0"},"peerDependencies":{"putout":">=42"},"license":"MIT","engines":{"node":">=22"},"publishConfig":{"access":"public"},"_id":"@putout/operator-regexp@5.2.0","gitHead":"e408ec48b22c6ba27745ad1069133ad488a206d4","types":"./lib/regexp.d.ts","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"26.4.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-lc0ILbghFgetG0MO66B2MLTU9iQGJ1q1wb2e6SddWktG2R6MtxXWZstC+nYOWUiZjRM6VCK/bgT8eofSsgcSEQ==","shasum":"bf74fd3ce38e942d23c0a08c70fafb9702ee285d","tarball":"http://registry-npm.ywwl.com/@putout/operator-regexp/download/@putout/operator-regexp-5.2.0.tgz","fileCount":8,"unpackedSize":6423,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDDTLAZgBw1VMpk6uREEq4bEwl0Yj6iBCyE2j4bVpX2gAIgA/VfSGXJjiLwO5P2YvcsIuqJMMQ4HwJ6hlocPblnsXU="}],"size":2930,"noattachment":false,"key":"/@putout/operator-regexp/-/@putout/operator-regexp-5.2.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/operator-regexp_5.2.0_1782574430486_0.071595829404548"},"_hasShrinkwrap":false,"readme":"# @putout/operator-regexp [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/operator-regexp.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/operator-regexp \"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) operator adds ability to determine that provided [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) can be\nconverted to [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) without losing it's sense.\n\nIt is used for example in [regexp/convert-replace-to-relace-all](https://github.com/coderaiser/putout/tree/master/packages/plugin-regexp#regexpconvert-replace-to-replace-all):\n\n```diff\n-'hello'.replace(/hello/g, 'world');\n+'hello'.replaceAll('hello', 'world');\n```\n\n## Install\n\n```\nnpm i putout @putout/operator-regexp\n```\n\n## API\n\n### isSimpleRegexp(regexp: RegExp)\n\n```js\nconst {operator} = require('putout');\nconst {isSimpleRegExp} = operator;\n\nisSimpleRegExp(/hello world/);\n// returns\ntrue;\n\nisSimpleRegExp(/^hello/);\n// returns\nfalse;\n```\n\n### transformRegExp(regexp: String, plugin: Traverser)\n\n```js\ntransformRegExp('[aab]', {\n    report,\n    fix,\n    traverse,\n});\n```\n\n### getStringFromRegExp(pattern: String)\n\nTo avoid errors like this:\n\n> SyntaxError: Expecting Unicode escape sequence \\uXXXX\n\nconst string = getStringFromRegExp(regexpNode);\n\n## License\n\nMIT\n","publish_time":1782574430661,"_cnpm_publish_time":1782574430661,"dist-tags":{"latest":"5.2.0"}}