@pulsecharterconnect/types 0.2.33 → 0.2.34
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/dist/types/Trip.d.ts +1 -1
- package/dist/types/Trip.js +9 -12
- package/package.json +1 -1
package/dist/types/Trip.d.ts
CHANGED
|
@@ -238,5 +238,5 @@ export declare class Trip implements ITrip {
|
|
|
238
238
|
createdAt?: number;
|
|
239
239
|
updatedAt?: number;
|
|
240
240
|
constructor(trip: ITrip);
|
|
241
|
-
sortTripSegments(): Array<ITripSegment>;
|
|
242
241
|
}
|
|
242
|
+
export declare function sortTripSegments(tripSegments: Array<ITripSegment>): Array<ITripSegment>;
|
package/dist/types/Trip.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Trip = exports.Participant = exports.Gender = exports.TripParticipantRole = exports.TripActions = exports.SegmentType = exports.OrganRecoveryInProcessStatus = exports.SegmentStatus = exports.getOrganRecoveryInProcessStatusLabel = exports.getSegmentStatusLabel = exports.getTripStatusLabel = exports.TripStatus = void 0;
|
|
3
|
+
exports.sortTripSegments = exports.Trip = exports.Participant = exports.Gender = exports.TripParticipantRole = exports.TripActions = exports.SegmentType = exports.OrganRecoveryInProcessStatus = exports.SegmentStatus = exports.getOrganRecoveryInProcessStatusLabel = exports.getSegmentStatusLabel = exports.getTripStatusLabel = exports.TripStatus = void 0;
|
|
4
4
|
var TripStatus;
|
|
5
5
|
(function (TripStatus) {
|
|
6
6
|
TripStatus["PREPARATION"] = "preparation";
|
|
@@ -166,16 +166,13 @@ class Trip {
|
|
|
166
166
|
this.createdAt = trip.createdAt;
|
|
167
167
|
this.updatedAt = trip.updatedAt;
|
|
168
168
|
}
|
|
169
|
-
sortTripSegments() {
|
|
170
|
-
var _a;
|
|
171
|
-
if (!this.tripSegments)
|
|
172
|
-
return [];
|
|
173
|
-
const tripSegments = (_a = this.tripSegments) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.scheduledDepartureTime - b.scheduledDepartureTime);
|
|
174
|
-
for (const [idx, tripSegment] of tripSegments === null || tripSegments === void 0 ? void 0 : tripSegments.entries()) {
|
|
175
|
-
tripSegment.segmentNumber = idx + 1;
|
|
176
|
-
}
|
|
177
|
-
this.tripSegments = tripSegments;
|
|
178
|
-
return tripSegments;
|
|
179
|
-
}
|
|
180
169
|
}
|
|
181
170
|
exports.Trip = Trip;
|
|
171
|
+
function sortTripSegments(tripSegments) {
|
|
172
|
+
tripSegments = tripSegments.sort((a, b) => a.scheduledDepartureTime - b.scheduledDepartureTime);
|
|
173
|
+
for (const [idx, tripSegment] of tripSegments.entries()) {
|
|
174
|
+
tripSegment.segmentNumber = idx + 1;
|
|
175
|
+
}
|
|
176
|
+
return tripSegments;
|
|
177
|
+
}
|
|
178
|
+
exports.sortTripSegments = sortTripSegments;
|