@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/esm/itinerary.js +5 -2
- package/esm/itinerary.js.map +1 -1
- package/esm/profile.js +1 -1
- package/esm/profile.js.map +1 -1
- package/esm/query-gen.js +2 -2
- package/esm/query-gen.js.map +1 -1
- package/lib/core-utils.story.js +1 -1
- package/lib/core-utils.story.js.map +1 -1
- package/lib/itinerary.d.ts +1 -1
- package/lib/itinerary.d.ts.map +1 -1
- package/lib/itinerary.js +5 -2
- package/lib/itinerary.js.map +1 -1
- package/lib/profile.js +1 -1
- package/lib/profile.js.map +1 -1
- package/lib/query-gen.js +2 -2
- package/lib/query-gen.js.map +1 -1
- package/package.json +2 -2
- package/src/core-utils.story.tsx +1 -1
- package/src/itinerary.ts +6 -2
- package/src/otpSchema.json +2869 -580
- package/src/planQuery.graphql +13 -11
- package/src/profile.js +1 -1
- package/src/query-gen.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
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
|
-
|
|
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)
|