{"name":"@eslint-community/regexpp","version":"4.12.2","description":"Regular expression parser for ECMAScript.","keywords":["regexp","regular","expression","parser","validator","ast","abstract","syntax","tree","ecmascript","es2015","es2016","es2017","es2018","es2019","es2020","es2021","annexB"],"homepage":"https://github.com/eslint-community/regexpp#readme","bugs":{"url":"https://github.com/eslint-community/regexpp/issues"},"repository":{"type":"git","url":"git+https://github.com/eslint-community/regexpp.git"},"license":"MIT","author":{"name":"Toru Nagashima"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","default":"./index.js"},"./package.json":"./package.json"},"main":"index","scripts":{"prebuild":"npm run -s clean","build":"run-s build:*","build:tsc":"tsc --module es2015","build:rollup":"rollup -c","build:dts":"npm run -s build:tsc -- --removeComments false && dts-bundle --name @eslint-community/regexpp --main .temp/index.d.ts --out ../index.d.ts && prettier --write index.d.ts","clean":"rimraf .temp index.*","lint":"eslint . --ext .ts","test":"nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000","debug":"mocha --require ts-node/register/transpile-only \"test/*.ts\" --reporter dot --timeout 10000","update:test":"ts-node scripts/update-fixtures.ts","update:unicode":"run-s update:unicode:*","update:unicode:ids":"ts-node scripts/update-unicode-ids.ts","update:unicode:props":"ts-node scripts/update-unicode-properties.ts","update:test262:extract":"ts-node -T scripts/extract-test262.ts","preversion":"npm test && npm run -s build","postversion":"git push && git push --tags","prewatch":"npm run -s clean","watch":"_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"},"dependencies":{},"devDependencies":{"@eslint-community/eslint-plugin-mysticatea":"^15.5.1","@rollup/plugin-node-resolve":"^14.1.0","@types/eslint":"^8.44.3","@types/jsdom":"^16.2.15","@types/mocha":"^9.1.1","@types/node":"^12.20.55","dts-bundle":"^0.7.3","eslint":"^8.50.0","js-tokens":"^8.0.2","jsdom":"^19.0.0","mocha":"^9.2.2","npm-run-all2":"^6.2.2","nyc":"^14.1.1","rimraf":"^3.0.2","rollup":"^2.79.1","rollup-plugin-sourcemaps":"^0.6.3","ts-node":"^10.9.1","typescript":"~5.0.2"},"engines":{"node":"^12.0.0 || ^14.0.0 || >=16.0.0"},"gitHead":"11f93e01a21638fc2b95dfcd750ff1385ed9c5f1","types":"./index.d.ts","_id":"@eslint-community/regexpp@4.12.2","_nodeVersion":"24.10.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==","shasum":"bccdf615bcf7b6e8db830ec0b8d21c9a25de597b","tarball":"http://registry-npm.ywwl.com/@eslint-community/regexpp/download/@eslint-community/regexpp-4.12.2.tgz","fileCount":8,"unpackedSize":473994,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eslint-community%2fregexpp@4.12.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH8zjkpMp3pvXvgAZUZvLyOaU2K/bqdZBhcqPuXFZa+4AiAr8KQRC0K8f9cxYxgu+uv5tG8h8UaZejFGXsX/fqx2YQ=="}],"size":73417,"noattachment":false,"key":"/@eslint-community/regexpp/-/@eslint-community/regexpp-4.12.2.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f4372bdc-57a8-4617-89da-de6a60f5ce6b"}},"directories":{},"maintainers":[{"name":"eslint-community-bot","email":"contact+eslintcbot@eslint.org"},{"name":"michaeldeboey","email":"info@michaeldeboey.be"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/regexpp_4.12.2_1761134160587_0.8477426016626193"},"_hasShrinkwrap":false,"readme":"# @eslint-community/regexpp\n\n[![npm version](https://img.shields.io/npm/v/@eslint-community/regexpp.svg)](https://www.npmjs.com/package/@eslint-community/regexpp)\n[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/regexpp.svg)](http://www.npmtrends.com/@eslint-community/regexpp)\n[![Build Status](https://github.com/eslint-community/regexpp/workflows/CI/badge.svg)](https://github.com/eslint-community/regexpp/actions)\n[![codecov](https://codecov.io/gh/eslint-community/regexpp/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/regexpp)\n\nA regular expression parser for ECMAScript.\n\n## 💿 Installation\n\n```bash\n$ npm install @eslint-community/regexpp\n```\n\n- require Node@^12.0.0 || ^14.0.0 || >=16.0.0.\n\n## 📖 Usage\n\n```ts\nimport {\n    AST,\n    RegExpParser,\n    RegExpValidator,\n    RegExpVisitor,\n    parseRegExpLiteral,\n    validateRegExpLiteral,\n    visitRegExpAST\n} from \"@eslint-community/regexpp\"\n```\n\n### parseRegExpLiteral(source, options?)\n\nParse a given regular expression literal then make AST object.\n\nThis is equivalent to `new RegExpParser(options).parseLiteral(source)`.\n\n- **Parameters:**\n    - `source` (`string | RegExp`) The source code to parse.\n    - `options?` ([`RegExpParser.Options`]) The options to parse.\n- **Return:**\n    - The AST of the regular expression.\n\n### validateRegExpLiteral(source, options?)\n\nValidate a given regular expression literal.\n\nThis is equivalent to `new RegExpValidator(options).validateLiteral(source)`.\n\n- **Parameters:**\n    - `source` (`string`) The source code to validate.\n    - `options?` ([`RegExpValidator.Options`]) The options to validate.\n\n### visitRegExpAST(ast, handlers)\n\nVisit each node of a given AST.\n\nThis is equivalent to `new RegExpVisitor(handlers).visit(ast)`.\n\n- **Parameters:**\n    - `ast` ([`AST.Node`]) The AST to visit.\n    - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks.\n\n### RegExpParser\n\n#### new RegExpParser(options?)\n\n- **Parameters:**\n    - `options?` ([`RegExpParser.Options`]) The options to parse.\n\n#### parser.parseLiteral(source, start?, end?)\n\nParse a regular expression literal.\n\n- **Parameters:**\n    - `source` (`string`) The source code to parse. E.g. `\"/abc/g\"`.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n- **Return:**\n    - The AST of the regular expression.\n\n#### parser.parsePattern(source, start?, end?, flags?)\n\nParse a regular expression pattern.\n\n- **Parameters:**\n    - `source` (`string`) The source code to parse. E.g. `\"abc\"`.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n    - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode.\n- **Return:**\n    - The AST of the regular expression pattern.\n\n#### parser.parseFlags(source, start?, end?)\n\nParse a regular expression flags.\n\n- **Parameters:**\n    - `source` (`string`) The source code to parse. E.g. `\"gim\"`.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n- **Return:**\n    - The AST of the regular expression flags.\n\n### RegExpValidator\n\n#### new RegExpValidator(options)\n\n- **Parameters:**\n    - `options` ([`RegExpValidator.Options`]) The options to validate.\n\n#### validator.validateLiteral(source, start, end)\n\nValidate a regular expression literal.\n\n- **Parameters:**\n    - `source` (`string`) The source code to validate.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n\n#### validator.validatePattern(source, start, end, flags)\n\nValidate a regular expression pattern.\n\n- **Parameters:**\n    - `source` (`string`) The source code to validate.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n    - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode.\n\n#### validator.validateFlags(source, start, end)\n\nValidate a regular expression flags.\n\n- **Parameters:**\n    - `source` (`string`) The source code to validate.\n    - `start?` (`number`) The start index in the source code. Default is `0`.\n    - `end?` (`number`) The end index in the source code. Default is `source.length`.\n\n### RegExpVisitor\n\n#### new RegExpVisitor(handlers)\n\n- **Parameters:**\n    - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks.\n\n#### visitor.visit(ast)\n\nValidate a regular expression literal.\n\n- **Parameters:**\n    - `ast` ([`AST.Node`]) The AST to visit.\n\n## 📰 Changelog\n\n- [GitHub Releases](https://github.com/eslint-community/regexpp/releases)\n\n## 🍻 Contributing\n\nWelcome contributing!\n\nPlease use GitHub's Issues/PRs.\n\n### Development Tools\n\n- `npm test` runs tests and measures coverage.\n- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`.\n- `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`.\n- `npm run lint` runs ESLint.\n- `npm run update:test` updates test fixtures.\n- `npm run update:ids` updates `src/unicode/ids.ts`.\n- `npm run watch` runs tests with `--watch` option.\n\n[`AST.Node`]: src/ast.ts#L4\n[`RegExpParser.Options`]: src/parser.ts#L743\n[`RegExpValidator.Options`]: src/validator.ts#L220\n[`RegExpVisitor.Handlers`]: src/visitor.ts#L291\n","publish_time":1761134160818,"_cnpm_publish_time":1761134160818,"dist-tags":{"latest":"4.12.4"}}