{"name":"issue-regex","version":"4.3.0","description":"Regular expression for matching issue references","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/issue-regex.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["issue","issues","pr","pull","request","reference","references","regex","regexp","regular","expression","github","gh","link"],"devDependencies":{"ava":"^6.1.3","tsd":"^0.31.2","xo":"^0.56.0"},"xo":{"rules":{"// Due to https://github.com/avajs/eslint-plugin-ava/issues/344":"off","ava/assertion-arguments":"off"}},"_id":"issue-regex@4.3.0","gitHead":"7bee0607c7bd4f1e3f84884edfbadfd20f148ecb","bugs":{"url":"https://github.com/sindresorhus/issue-regex/issues"},"homepage":"https://github.com/sindresorhus/issue-regex#readme","_nodeVersion":"22.6.0","_npmVersion":"10.6.0","dist":{"integrity":"sha512-7731a/t2llyrk8Hdwl1x3LkhIFGzxHQGpJA7Ur9cIRViakQF2y25Lwhx8Ziy1B068+kBYUmYPBzw5uo3DdWrdQ==","shasum":"e73db1b475fa12b93ddc66c36ebd5a5f57d0d838","tarball":"http://registry-npm.ywwl.com/issue-regex/download/issue-regex-4.3.0.tgz","fileCount":5,"unpackedSize":4976,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFR48+v79Po38D+GNpZzBnNA1aTOXiv6EEUTCN1U1DsnAiEAsByEEng9BeeK38TlMZIKSUGYbHgAAnJ7ek5IX612YEc="}],"size":2391,"noattachment":false,"key":"/issue-regex/-/issue-regex-4.3.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/issue-regex_4.3.0_1727287720596_0.32842117980306806"},"_hasShrinkwrap":false,"readme":"# issue-regex\n\n> Regular expression for matching issue references\n\n## Install\n\n```sh\nnpm install issue-regex\n```\n\n## Usage\n\n```js\nimport issueRegex from 'issue-regex';\n\n'Fixes #143 and avajs/ava#1023'.match(issueRegex());\n//=> ['#143', 'avajs/ava#1023']\n```\n\nOrganization name, repository name, and issue number are also available individually in capturing groups 1-3, or named groups `organization`, `repository`, and `issueNumber`:\n\n```js\nissueRegex().exec('Fixes avajs/ava#1023');\n/*\n[\n\t'avajs/ava#1023',\n\t'avajs',\n\t'ava',\n\t'1023',\n\tindex: 6,\n\tinput: 'Fixes avajs/ava#1023',\n\tgroups: {\n\t\torganization: 'avajs',\n\t\trepository: 'ava',\n\t\tissueNumber: '1023'\n\t}\n]\n*/\n```\n\n## API\n\n### issueRegex(options?)\n\nReturns a `RegExp` for matching issue references.\n\n### options\n\nType: `object`\n\n#### additionalPrefix\n\nSupport for references like `GH-123` can be added manually. Adding a prefix will still match the #-based references:\n\n```js\nimport issueRegex from 'issue-regex';\n\nissueRegex({additionalPrefix: 'GH-'}).exec('GH-123');\n//=> ['GH-123', 'GH-', '123']\n\n'Fixes GH-143 and avajs/ava#1023'.match(issueRegex({additionalPrefix: 'GH-'}));\n//=> ['GH-143', 'avajs/ava#1023']\n```\n\n> [!NOTE]\n> `additionalPrefix` is added unescaped to the regex, keep it simple.\n\n## Important\n\nIf you run the regex against untrusted user input in a server context, you should [give it a timeout](https://github.com/sindresorhus/super-regex).\n\n**I do not consider ReDoS a valid vulnerability for this package.**\n\n## Related\n\n- [linkify-issues](https://github.com/sindresorhus/linkify-issues) - Linkify GitHub issue references\n","publish_time":1727287720793,"_cnpm_publish_time":1727287720793,"dist-tags":{"latest":"4.3.0"}}