{"_id":"regexp-match-indices","_rev":"3-4d56f27fc927aeb1a33eeff99e077096","name":"regexp-match-indices","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"regexp-match-indices","version":"1.0.0","description":"RegExp Match Indices polyfill","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"tsc -b --clean ./tsconfig.json","build":"tsc -b ./tsconfig.json","test":"jest","test-watch":"jest --watch","prepublishOnly":"npm run clean & npm run build & npm run test"},"author":{"name":"Ron Buckton","url":"rbuckton@chronicles.org"},"license":"Apache-2.0","dependencies":{"regexp-tree":"^0.1.11"},"devDependencies":{"@types/jest":"^22.2.0","jest":"^24.8.0","ts-jest":"^24.0.2","typescript":"^3.5.3"},"jest":{"testEnvironment":"node","moduleFileExtensions":["ts","js"],"transform":{"\\.ts$":"ts-jest"},"testRegex":"__tests__/.*(?<!\\.d)\\.ts$","collectCoverage":false,"collectCoverageFrom":["*.ts","shim/*.ts"],"coverageDirectory":"coverage","coverageReporters":["lcov"]},"gitHead":"25789a49f604f2999bb10ece7c435455d9ca1242","_id":"regexp-match-indices@1.0.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-0QXuSEvn8jcnU7vC27bXUQKs8DEoCuv4fmMcHVQ8Cn1qLkD4VCOA7BIFZPHFu8UltdDkyavc35oaUBwLZp0aWQ==","shasum":"9cf48ad83fc17755023657f192cbfff85f53f1fe","tarball":"https://registry.npmjs.org/regexp-match-indices/-/regexp-match-indices-1.0.0.tgz","fileCount":25,"unpackedSize":64654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOpPeCRA9TVsSAnZWagAAzDQQAI9GQlw3ksfSQ6PTpt8p\nRWLbRGcuxczh47aENEwgYpY1gSpz03zXV+legb1+KwSejNRK4CTfaC5VC4u5\n03cHS1mclH+htQCEx4H8RGsubYrzXXYBeu69A8LXdCtBcU2kLNKPa01gBsZs\nZwxmhBi/Pqumx5PmRqQHHjKTxJUS/M7aKO9NkQgQiu1FfEEFY8FLYbnp/77v\n91AfMoNfrHgVAZYR+oz6pzOFORW4VmSI1l7DmzN1e7D88Q8SSSqDJGT+HfK0\nc7VT/hh+I1Cz2iWh5WHT58CeDNdNMvczhhCM5UOH3+y+jfcShEdiqlruYteP\nFmwXr5+nC0zvUui+wY1XLuxZY7RxNeIp98BLj2aC7JqkPwXdnTfOXk0MPJMf\ncOiuz5YSyjWxdhvkiWuo/Y5a+xv2FYqFpkP0csHG8jcZpVfac5gV6dduIK+3\np6uaiO8em+Txy+x1aQu2mqtRdXX76V1ZuBHRKj1UJIoxlDf7LMw2/jX8eW9V\nDSfucXDdqGjDK3fQgS23Hw22b6Hp7wULgWA6lhssbnRXJ9+sO6OXT4Npazof\nSXpw6+I+UyUpw8oDENLpCN5TMtbXbGqiZVK+y6HnNdPSyqBfI8F5lnXCi/mb\nRwgCCU5nP5WDes48nULZh5Y2hSiaGLaUfEp4mMDtOGNEdUNUqO00gfPHMH2I\n90B/\r\n=SsGT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLjYn8jS1RAYRC4v/POPdFbFKHf8BLXO73Mb3KPw/WHAiEAkZNVIaUV3eJwmlax11X0Jw286ZPaaNzB59SjS9ClMyg="}]},"maintainers":[{"name":"rbuckton","email":"rbuckton@chronicles.org"}],"_npmUser":{"name":"rbuckton","email":"rbuckton@chronicles.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexp-match-indices_1.0.0_1564120029378_0.7638681651047097"},"_hasShrinkwrap":false},"1.0.1":{"name":"regexp-match-indices","version":"1.0.1","description":"RegExp Match Indices polyfill","main":"index.js","types":"index.d.ts","scripts":{"clean":"tsc -b --clean ./tsconfig.json","build":"tsc -b ./tsconfig.json","test":"jest","test-watch":"jest --watch","prepublishOnly":"npm run clean & npm run build & npm run test"},"author":{"name":"Ron Buckton","url":"rbuckton@chronicles.org"},"license":"Apache-2.0","dependencies":{"regexp-tree":"^0.1.11"},"devDependencies":{"@types/jest":"^22.2.0","jest":"^24.8.0","ts-jest":"^24.0.2","typescript":"^3.5.3"},"jest":{"testEnvironment":"node","moduleFileExtensions":["ts","js"],"transform":{"\\.ts$":"ts-jest"},"testRegex":"__tests__/.*(?<!\\.d)\\.ts$","collectCoverage":false,"collectCoverageFrom":["*.ts","shim/*.ts"],"coverageDirectory":"coverage","coverageReporters":["lcov"]},"gitHead":"25789a49f604f2999bb10ece7c435455d9ca1242","_id":"regexp-match-indices@1.0.1","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-aSkBHqn/FtMoMyCJH79R5pbXOfwn2Gb8acTBQuYv+YRBB3gsNjvRAMeB70+pGhC8mT7mmof+KnPM71ZxW5OshA==","shasum":"2c987e4d73867abe55d13827002a4b8c3d390814","tarball":"https://registry.npmjs.org/regexp-match-indices/-/regexp-match-indices-1.0.1.tgz","fileCount":25,"unpackedSize":64644,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOpQ3CRA9TVsSAnZWagAAUngP/jpWYq0BrbT/jeP3J5ad\ngooAuMk8W/+LpDk0alePr5uG75S3xkf6QWmzZFXLXn7SWGmFDIF0rwff/9mK\n3dzk1K3UpisDumzqIoMIEPkG0J1woC/UMvTwK+FssZ0YvE5wwPrLSmDz0qCF\nUTH1BQCIHNtdLytb7tLeTeHd+VYKYyrNaCY/Mx41tfjdfrSSKZabG+Vb7FMU\napzV4x/fdpUm2sneQtUvEr4c8rECNh5giz8C/ZOoNsxvpBoUEj8uUpkw8KL0\nnC9VC2jRpZv8toEhG0Hr5dshMpii5ud0ztUTiUqSjtjFuQ5A0oxLnK9iVYxI\nkXMYh9dKlD28EnO9JH0vta88MYe+MJ8UhH8iJYWgrxoTsbnDuwps6+x4Kk+y\nYijxoIX8g+LZqP0SFAB0yHiaGSy5X+Rv9SO9EQwekRO8WXV5DgdzShuy65eF\nNdYDrLdcE1AneRECO/RBCTX97M+4U7/ZfGBfGR6t/IxhjgtqIikqI+fMtbI0\nFhZz6VD6THOL1R6Jlck2cd9rzmUgzRcm1cBwB54ugL7BnVs9bhdduOw4Ol9e\ndnvmv27YTZ2aVcrkvhJ+9RP4lKgkpwBHEbto02AgJtPD5L7k9KWgW9wS443q\nTEdG66twTkKbiHSwPYUlah8AOpQARj7qY6kALYqh6E+21Is7qj4DHG4hqANU\n7Kdl\r\n=Q6zd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIELyUgxKD0Aa5u2pS0mFrLZmvyYs0J21iLHXU+oJjMwKAiEAkg23iT1CuvjkRM1QV2cbL4JzoyiXXMdFHG7v3kVZfMQ="}]},"maintainers":[{"name":"rbuckton","email":"rbuckton@chronicles.org"}],"_npmUser":{"name":"rbuckton","email":"rbuckton@chronicles.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexp-match-indices_1.0.1_1564120119211_0.08527144684990717"},"_hasShrinkwrap":false},"1.0.2":{"name":"regexp-match-indices","version":"1.0.2","description":"RegExp Match Indices polyfill","main":"index.js","types":"index.d.ts","scripts":{"clean":"tsc -b --clean ./tsconfig.build.json","build":"tsc -b ./tsconfig.build.json","test":"jest","test-watch":"jest --watch","prepublishOnly":"npm run clean & npm run build & npm run test"},"author":{"name":"Ron Buckton","url":"rbuckton@chronicles.org"},"license":"Apache-2.0","dependencies":{"regexp-tree":"^0.1.11"},"devDependencies":{"@types/jest":"^24.0.18","@types/jest-expect-message":"^1.0.0","@types/jest-matcher-utils":"^21.0.2","jest":"^24.8.0","jest-expect-message":"^1.0.2","jest-extended":"^0.11.2","jest-matcher-utils":"^24.9.0","ts-jest":"^24.0.2","typescript":"^3.5.3"},"jest":{"testEnvironment":"node","moduleFileExtensions":["ts","js"],"transform":{"\\.ts$":"ts-jest"},"testRegex":"__tests__/[^_].*(?<!\\.d| copy)\\.ts$","collectCoverage":false,"collectCoverageFrom":["*.ts","shim/*.ts"],"coverageDirectory":"coverage","coverageReporters":["lcov"],"setupFilesAfterEnv":["jest-expect-message","jest-extended"]},"gitHead":"d8c70897b9cc58aca2b3e5d9a58f4f5ec29fbf40","_id":"regexp-match-indices@1.0.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-DwZuAkt8NF5mKwGGER1EGh2PRqyvhRhhLviH+R8y8dIuaQROlUfXjt4s9ZTXstIsSkptf06BSvwcEmmfheJJWQ==","shasum":"cf20054a6f7d5b3e116a701a7b00f82889d10da6","tarball":"https://registry.npmjs.org/regexp-match-indices/-/regexp-match-indices-1.0.2.tgz","fileCount":32,"unpackedSize":91602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYCGhCRA9TVsSAnZWagAA3TUP+QGj/nJlGTl8eg8mEPkF\nvLLg3SeJq2Ze//EUl6BLXHpS50lkhz6O6owSAMhMwycs97yFo5aADhvfa+JB\nnZPvQLcih2LxSceDLx0IPJX6xc071ccagjWRjlVv1//+fX6FkJK5rrZ15XTw\n1lAleUS0EEPSJCxpQpt7w/Ta9rJ/UdKDDl6xraz/mxFreH6i7X08hNLZcMT7\n87gRPqs4e6WFvMGN1cJnRitcDaGJvaovfitJQjQX9CTYJXlDoTCdcM7kcIk9\n4fst9F3acsECKzXR+6X35XNA9MvV03byYTR0OpdmkK581kcalfPmP4+Dl9DY\nQUEQs/srtFSiW6g1RbL+SmMf/P7/9wxYJ4A7SxeCq2lkoUb8GxULs+qyN5RB\nI7vBuq4Bdc+G9DPdDKSHgd7ZunOvCUV46Qcv+n6l/8IhjE4wa7xyBP5OFvTH\nF3fGCQuyzIYgovAgjtF/WfVX6pryuM+LcejS3jeyeYiGbHWExA9NINZZ2YmI\ngjjJWJEBv71QMr/MRWb+x65FehzUyriWWKUV4l7y/tjVfJOkKecef2dJEl5H\n5c8pmwK6BKR76kMMW7SMgPX4VLfVoEJKE1jsNW3dJS4T533ywnDeRMoroBCe\nZhiXJzgtJBx9YV/FI+CLir4TI9aHnjR4jyw/EF8+mleWKYngex37suAx+zSh\nKPPX\r\n=zKbE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC984otIenSZjBuK/HixelSazXDr3bHQy0pjaaVvfv0xAiEAsgiDrXSE8A/wDt2qBaDIC+Kchi1SIzmPO/hmf2HAj4g="}]},"maintainers":[{"name":"rbuckton","email":"rbuckton@chronicles.org"}],"_npmUser":{"name":"rbuckton","email":"rbuckton@chronicles.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regexp-match-indices_1.0.2_1566581153065_0.8090763160872176"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-26T05:47:09.378Z","1.0.0":"2019-07-26T05:47:09.539Z","modified":"2022-05-15T17:01:45.554Z","1.0.1":"2019-07-26T05:48:39.335Z","1.0.2":"2019-08-23T17:25:53.241Z"},"maintainers":[{"name":"rbuckton","email":"rbuckton@chronicles.org"}],"description":"RegExp Match Indices polyfill","author":{"name":"Ron Buckton","url":"rbuckton@chronicles.org"},"license":"Apache-2.0","readme":"# regexp-match-indices\r\n\r\nThis package provides a polyfill/shim for the [RegExp Match Indices](https://github.com/tc39/proposal-regexp-match-indices) proposal.\r\n\r\nThe implementation is a replacement for `RegExp.prototype.exec` that approximates the beahvior of the proposal. Because `RegExp.prototype.exec` depends on a receiver (the `this` value), the main export accepts the `RegExp` to operate on as the first argument.\r\n\r\n## Installation\r\n\r\n```sh\r\nnpm install regexp-match-indices\r\n```\r\n\r\n## Usage\r\n\r\n### Standalone\r\n\r\n```js\r\nconst execWithIndices = require(\"regexp-match-indices\");\r\n\r\nconst text = \"zabbcdef\";\r\nconst re = new RegExp(\"ab*(cd(?<Z>ef)?)\");\r\nconst result = execWithIndices(re, text);\r\nconsole.log(result.indices);    // [[1, 8], [4, 8], [6, 8]]\r\n```\r\n\r\n### Shim\r\n\r\n```js\r\nrequire(\"regexp-match-indices\").shim();\r\n// or\r\nrequire(\"regexp-match-indices/shim\")();\r\n// or\r\nrequire(\"regexp-match-indices/auto\");\r\n\r\nconst text = \"zabbcdef\";\r\nconst re = new RegExp(\"ab*(cd(?<Z>ef)?)\");\r\nconst result = re.exec(re, text);\r\nconsole.log(result.indices);    // [[1, 8], [4, 8], [6, 8]]\r\n```\r\n\r\n## Configuration\r\n\r\nThe polyfill can be run in two modes: `\"lazy\"` (default) or `\"spec-compliant\"`. In `\"spec-compliant\"` mode, the `indices` property is populated and stored on the result as soon as `exec()` is called. This can have a significant performance penalty for existing RegExp's that do not use this feature. By default, the polyfill operates in `\"lazy\"` mode, where the `indices` property is defined using a getter and is only computed when first requested.\r\n\r\nYou can specify the configuration globally using the following:\r\n\r\n```js\r\nrequire(\"regexp-match-indices\").config.mode = \"spec-compliant\"; // or \"lazy\"\r\n// or\r\nrequire(\"regexp-match-indices/config\").mode = \"spec-compliant\"; // or \"lazy\"\r\n```","readmeFilename":"README.md"}