lib/hand-rank.js
function handRank(val) {
  if (val > 6185) return HIGH_CARD        // 1277 high card
  if (val > 3325) return ONE_PAIR         // 2860 one pair
  if (val > 2467) return TWO_PAIR         //  858 two pair
  if (val > 1609) return THREE_OF_A_KIND  //  858 three-kind
  if (val > 1599) return STRAIGHT         //   10 straights
  if (val > 322)  return FLUSH            // 1277 flushes
  if (val > 166)  return FULL_HOUSE       //  156 full house
  if (val > 10)   return FOUR_OF_A_KIND   //  156 four-kind
  return STRAIGHT_FLUSH                   //   10 straight-flushes
}
function handRank(val) {
  if (val > 6185) return HIGH_CARD        // 1277 high card
  if (val > 3325) return ONE_PAIR         // 2860 one pair
  if (val > 2467) return TWO_PAIR         //  858 two pair
  if (val > 1609) return THREE_OF_A_KIND  //  858 three-kind
  if (val > 1599) return STRAIGHT         //   10 straights
  if (val > 322)  return FLUSH            // 1277 flushes
  if (val > 166)  return FULL_HOUSE       //  156 full house
  if (val > 10)   return FOUR_OF_A_KIND   //  156 four-kind
  return STRAIGHT_FLUSH                   //   10 straight-flushes
}
function handRank ( val ) { if ( val > 6185 ) return HIGH_CARD // 1277 high card if ( val > 3325 ) return ONE_PAIR // 2860 one pair if ( val > 2467 ) return TWO_PAIR //  858 two pair if ( val > 1609 ) return THREE_OF_A_KIND //  858 three-kind if ( val > 1599 ) return STRAIGHT //   10 straights if ( val > 322 ) return FLUSH // 1277 flushes if ( val > 166 ) return FULL_HOUSE //  156 full house if ( val > 10 ) return FOUR_OF_A_KIND //  156 four-kind return STRAIGHT_FLUSH //   10 straight-flushes }
Converts a hand strength number into a hand rank number
`0 - 8` for `STRAIGHT_FLUSH - HIGH_CARD`.

@name handRank
@function
@param {Number} val hand strength (result of an `evaluate` function)
@return {Number} the hand rank
Converts a hand strength number into a hand rank number 0 - 8 for STRAIGHT_FLUSH - HIGH_CARD .