function dedupeOnHostPort (results) {
  return (
    _.chain(results)
      // Flatten list of lists of objects
      .flatten()
      // De-dupe nodes by broadcast address / port
      .keyBy(item => {
        if (item.broadcast_address) {
          return `${item.broadcast_address}:${item.tcp_port}`
        } else {
          return `${item.hostname}:${item.tcp_port}`
        }
      })
      .values()
      .value()
  )
}
/**
 * Takes a list of responses from lookupds and dedupes the nsqd
 * hosts based on host / port pair.
 *
 * @param {Array} results - list of lists of nsqd node objects.
 * @return {Array}
 */
Takes a list of responses from lookupds and dedupes the nsqd
hosts based on host / port pair.

@param {Array} results - list of lists of nsqd node objects.
@return {Array}
Takes a list of responses from lookupds and dedupes the nsqd hosts based on host / port pair . @param { Array } results - list of lists of nsqd node objects . @return { Array }
function dedupeOnHostPort (results) {
  return (
    _.chain(results)
      .flatten()
      .keyBy(item => {
        if (item.broadcast_address) {
          return `${item.broadcast_address}:${item.tcp_port}`
        } else {
          return `${item.hostname}:${item.tcp_port}`
        }
      })
      .values()
      .value()
  )
}
function dedupeOnHostPort ( results ) { return ( _ . chain ( results ) . flatten ( ) . keyBy ( item => { if ( item . broadcast_address ) { return ` ${ item . broadcast_address } ${ item . tcp_port } ` } else { return ` ${ item . hostname } ${ item . tcp_port } ` } } ) . values ( ) . value ( ) ) }
Takes a list of responses from lookupds and dedupes the nsqd
 hosts based on host / port pair.
Takes a list of responses from lookupds and dedupes the nsqd hosts based on host / port pair .
// Flatten list of lists of objects // De-dupe nodes by broadcast address / port