@pulsecharterconnect/types 0.2.32 → 0.2.33

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.
@@ -238,4 +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>;
241
242
  }
@@ -166,5 +166,16 @@ 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
+ }
169
180
  }
170
181
  exports.Trip = Trip;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulsecharterconnect/types",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
4
4
  "description": "A TypeScript library for enhanced type safety.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",