docs: function combineSearch(tp1, tp2) {
    return tp1.map(travelPlan => {
      let arrival = new Date(travelPlan.legs[travelPlan.legs.length - 1].arrival)
      let bestWaitTime = Infinity
      let bestTravelPlan2 = tp2[0]
      // Find the most appropriate corresponding second travel plan.
      for (let i = 0; i < tp2.length; i++) {
        let travelPlan2 = tp2[i]
        let departure = new Date(travelPlan2.legs[0].departure)
        let waitTime = departure - arrival
        if (waitTime > 0) {
          if (waitTime < bestWaitTime) {
            bestWaitTime = waitTime
            bestTravelPlan2 = travelPlan2
          }
        }
      }
      return {
        fares: combineFares(travelPlan.fares, bestTravelPlan2.fares),
        legs: travelPlan.legs.slice().concat(bestTravelPlan2.legs.slice()),
      }
    })
  }