@pulsecharterconnect/types 0.2.32 → 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.
@@ -239,3 +239,4 @@ export declare class Trip implements ITrip {
239
239
  updatedAt?: number;
240
240
  constructor(trip: ITrip);
241
241
  }
242
+ export declare function sortTripSegments(tripSegments: Array<ITripSegment>): Array<ITripSegment>;
@@ -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";
@@ -168,3 +168,11 @@ class Trip {
168
168
  }
169
169
  }
170
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulsecharterconnect/types",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
4
4
  "description": "A TypeScript library for enhanced type safety.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",