{"name":"@putout/operator-regexp","version":"5.0.0","keywords":["putout","putout-operator","operator","regexp"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/operator-regexp@5.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/operator-regexp#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"f6905bf7cbf21910233f5015fdd3981e9a5d7184","tarball":"http://registry-npm.ywwl.com/@putout/operator-regexp/download/@putout/operator-regexp-5.0.0.tgz","fileCount":6,"integrity":"sha512-fdThgL76DVW2xRerVJ/d0fAiAHBRokg0I4hLXtGF0nPUPOuHFbnoLZJkK+r/IRa9ebEiMYeQ0fFod8ggYGA9Kg==","signatures":[{"sig":"MEQCIEr0qYiYZEcRqUB/lVQTGa4ugjDqsDSKQqQRqJXmV3XqAiAjsdNL3BqLwvaTgbWqsN96O0IKoGoCXMrSnhelMQmU4A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5328,"size":2498,"noattachment":false,"key":"/@putout/operator-regexp/-/@putout/operator-regexp-5.0.0.tgz"},"main":"lib/regexp.js","type":"module","engines":{"node":">=22"},"gitHead":"2f4d3fd97b71ba3901ff7c8b02e5e25aace95c53","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git+https://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"11.4.2","description":"🐊Putout operator adds ability to check if provided regexp can be converted to string without losing it's sense","directories":{},"_nodeVersion":"24.14.0","dependencies":{"regexp-tree":"^0.1.24"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^10.0.0","madrun":"^13.0.0","montag":"^1.2.1","nodemon":"^3.0.1","superc8":"^12.0.0","supertape":"^12.0.0","try-catch":"^4.0.0","@putout/test":"^15.0.0","eslint-plugin-putout":"^31.0.0"},"peerDependencies":{"putout":">=42"},"_npmOperationalInternal":{"tmp":"tmp/operator-regexp_5.0.0_1773396632150_0.028919602393139288","host":"s3://npm-registry-packages-npm-production"},"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":1773396632281,"_cnpm_publish_time":1773396632281,"dist-tags":{"latest":"5.2.0"}}