{"name":"@putout/operator-regexp","version":"4.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@4.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":"3d3d80afce9319025f9271ac4e0f18bca0698a00","tarball":"http://registry-npm.ywwl.com/@putout/operator-regexp/download/@putout/operator-regexp-4.0.0.tgz","fileCount":6,"integrity":"sha512-dDaTrjOpoWe4eWhkekHCD6m7U4pp9iZ5xEoTaWmF4oefF2dKJRRyY9KvWomOCfLzz3+8Rb3ap99JEDhwPGI+Pg==","signatures":[{"sig":"MEUCIQCt9nmm3DaOwqcsqNkBvrjhu29LIN0Fx/MkLXN7lHi+4QIgeHLf09UcfNiC/sBqv+VFfHBqm5j1/nj9rOAnAzP6WYo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5365,"size":2516,"noattachment":false,"key":"/@putout/operator-regexp/-/@putout/operator-regexp-4.0.0.tgz"},"main":"lib/regexp.js","type":"module","engines":{"node":">=22"},"gitHead":"d86b9c1ec0c89998435077456e30a62ed56548df","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":"25.2.1","dependencies":{"regexp-tree":"^0.1.24"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"^10.0.0-alpha.0","madrun":"^12.0.0","montag":"^1.2.1","nodemon":"^3.0.1","supertape":"^11.0.3","try-catch":"^4.0.0","@putout/test":"^15.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^29.0.0"},"peerDependencies":{"putout":">=41"},"_npmOperationalInternal":{"tmp":"tmp/operator-regexp_4.0.0_1767441420431_0.7910891348624249","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":1767441420578,"_cnpm_publish_time":1767441420578,"dist-tags":{"latest":"5.2.0"}}