@opentripplanner/core-utils 9.0.0 → 10.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/itinerary.ts CHANGED
@@ -78,6 +78,7 @@ export function legDropoffRequiresAdvanceBooking(leg: Leg): boolean {
78
78
  return isAdvanceBookingRequired(leg.dropOffBookingInfo);
79
79
  }
80
80
 
81
+ // alpha-only comment
81
82
  export function isRideshareLeg(leg: Leg): boolean {
82
83
  return !!leg.rideHailingEstimate?.provider?.id;
83
84
  }
@@ -408,10 +409,13 @@ export function getCompanyForNetwork(
408
409
  * @return {string} A label for use in presentation on a website.
409
410
  */
410
411
  export function getCompaniesLabelFromNetworks(
411
- networks: string[],
412
+ networks: string | string[],
412
413
  companies: Company[] = []
413
414
  ): string {
414
- return networks
415
+ let networksArray = networks;
416
+ if (typeof networks === "string") networksArray = [networks];
417
+
418
+ return (networksArray as string[])
415
419
  .map(network => getCompanyForNetwork(network, companies))
416
420
  .filter(co => !!co)
417
421
  .map(co => co.label)