{"_id":"@botpoker/rank-hands","_rev":"1-1cf8b53e7dc3862085eacb8194b326da","name":"@botpoker/rank-hands","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@botpoker/rank-hands","version":"1.0.0","description":"Sort poker hands by texas hold'em ranking","main":"index.js","scripts":{"lint":"eslint index.js domain/*.js tests/*.js","test":"npm run lint && jest"},"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/poker-rank.git"},"keywords":["poker","poker rank","hold'em","hold'em ranking","evaluate","evaluate poker","evaluate hand","sort","sort poker","win","best","best poker","hand","rank","ranking"],"author":{"name":"Bruno Scopelliti"},"license":"MIT","bugs":{"url":"https://github.com/brunoscopelliti/poker-rank/issues"},"homepage":"https://github.com/brunoscopelliti/poker-rank","dependencies":{"@botpoker/hand":"1.0.0"},"devDependencies":{"eslint":"7.25.0","eslint-config-bruno":"3.0.0","jest":"26.6.3","pre-commit":"1.2.2"},"gitHead":"724824b4dbb0e90782c85e869d3446bc4724f4e9","_id":"@botpoker/rank-hands@1.0.0","_nodeVersion":"15.9.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-6yvR9WrWKsYAvSN3qUgBAmxDQAhCnEIL77VjQkxhr4ZbTOLfOsGaRgqkoULvJ/DyeHE3tZ67ogvkUg9LVwUAdw==","shasum":"3b5db57d482451da554d96b48f4079102970c9cd","tarball":"https://registry.npmjs.org/@botpoker/rank-hands/-/rank-hands-1.0.0.tgz","fileCount":10,"unpackedSize":14832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjljJCRA9TVsSAnZWagAAa1EP/0lkRkj/4XqcIU/A6Bct\n6qidbZCoKR4Pulds6p0XrWyw2FUNrRrprrTvdtyBHmQq4SSfEyAH/rdIBIoO\neGt6M2lNXTtK4KfCrqL5/f8XzuZQmjfS9rD6Sp+47ccLmtYIHa61S3S4fVJ0\njAz6puNEz32cDpCvHc8+Uxe91B/dMnRfdUiFR54oge249SlP+6GgXlltfwME\n9BqsXxdMaaEJOPOJjDtf3a4jEk2qvv8M5inR6TASvwSksWioc9JAsqGx5hK0\nTQGPF3aqNfOqeGx5ANaW5mdekQ2n3+ga6Hmlp4yyIYo4Q23dbh+Y/MLfgzKN\nScHvHJR9na4Qp1r8va3EjoI1mUPC1tmAQ98t8PVfsVuzbwBMsmbwHbpX7ahb\n6F86EDp4s5Km/L5JW++Bd72LaTh+0Td4cJQ9gvPv+Ex2cKYpeKN07ZxK0he4\nlB3qIUrE2E4Gf8MWZs8DKVazN7kNv3sm9IE25j38d+syzQc3+ex0dRkYVSCy\ng1Iy3hA1mD8JtxK1Zm9WsmTTwybgax43TZqk5ExmGseplNXqQIH00V5tkp+K\nVXAY0+v/nB0NXmu1BcOQsUh3aow8GwYWQMdd2oHJDCrHqBUsR2lDvw15ZIBS\nZ7f+uNuyuvQvvgNf5IPejsdKmOGNUARJv1WqNJ6ql5Db7Ls9BJyH3+G4+Z7x\nIi4t\r\n=BO0L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGWqh898Wp1wuqMEkNojq4rVXTIHDkFhfxh8GceOp5STAiEA69QtCtPuvz+nLPIq0VuVd0NdphhzfpwhHlKscRSo2Is="}]},"_npmUser":{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"},"directories":{},"maintainers":[{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rank-hands_1.0.0_1619941577065_0.744506828823601"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-02T07:46:16.703Z","1.0.0":"2021-05-02T07:46:17.208Z","modified":"2022-04-04T20:14:28.418Z"},"maintainers":[{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"}],"description":"Sort poker hands by texas hold'em ranking","homepage":"https://github.com/brunoscopelliti/poker-rank","keywords":["poker","poker rank","hold'em","hold'em ranking","evaluate","evaluate poker","evaluate hand","sort","sort poker","win","best","best poker","hand","rank","ranking"],"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/poker-rank.git"},"author":{"name":"Bruno Scopelliti"},"bugs":{"url":"https://github.com/brunoscopelliti/poker-rank/issues"},"license":"MIT","readme":"# @botpoker/rank-hands\n\nYou can install [@botpoker/rank-hands](https://www.npmjs.com/package/@botpoker/rank-hands) via npm:\n\n```\nnpm i @botpoker/rank-hands\n```\n\n## Intro\n\nIf you are making some sort of poker game, chances are that sooner or later you want to know in a group of cards combination what is the best.\n\nThis is exactly what `@botpoker/rank-hands` is for.\n\n`@botpoker/rank-hands` expects as input a list of cards combination. A cards combination is a list of five cards object (check [brunoscopelliti/poker-deck](https://github.com/brunoscopelliti/poker-deck)).\n\nIt sorts the input by the strength of the combination. The original index of each entry is added as `index` property on each entry.\n\n```js\nconst sortByRank = require(\"@botpoker/rank-hands\");\n\nconst sortedCombs = sortByRank([\n  [{ rank: \"A\", type: \"C\" },\n  { rank: \"9\", type: \"H\" }, { rank: \"J\", type: \"C\" }, { rank: \"8\", type: \"C\" }, { rank: \"2\", type: \"C\" }]\n  [{ rank: \"Q\", type: \"C\" }, { rank: \"3\", type: \"D\" }, { rank: \"3\", type: \"S\" }, { rank: \"J\", type: \"C\" }, { rank: \"4\", type: \"C\" }],\n]);\n\nsortedCombs;\n\n// [\n//   [\n//     { rank: \"Q\", type: \"C\" },\n//     { rank: \"3\", type: \"D\" },\n//     { rank: \"3\", type: \"S\" },\n//     { rank: \"J\", type: \"C\" },\n//     { rank: \"4\", type: \"C\" },\n//     index: 0,\n//     rank: {\n//       strength: 1,\n//       rank: \"3\",\n//       kickers: [\n//         \"Q\",\n//         \"J\",\n//         \"4\",\n//       ]\n//     }\n//   ],\n//   [\n//     { rank: \"A\", type: \"C\" },\n//     { rank: \"9\", type: \"H\" },\n//     { rank: \"J\", type: \"C\" },\n//     { rank: \"8\", type: \"C\" },\n//     { rank: \"2\", type: \"C\" },\n//     index: 0,\n//     rank: {\n//       strength: 0,\n//       rank: \"A\",\n//       kickers: [\n//         \"J\", \n//         \"9\", \n//         \"8\",\n//         \"2\",\n//       ]\n//     }\n//   ]\n// ]\n```\n\n`@botpoker/rank-hands` uses @botpoker/hand to evaluate the strength of a combination.\n\n`@botpoker/hand` also handles **ex-equo**. In case of ex-equo, the objects have also an `exequo` property.\n\n","readmeFilename":"README.md"}