Files
alrahma_sunday_school_api/apps/api/dist/modules/vehicles/vehicle.presenter.js
T
2026-06-11 03:22:12 -04:00

19 lines
723 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.presentVehicle = presentVehicle;
exports.presentVehicleList = presentVehicleList;
function normalizeLocations(value) {
return Array.isArray(value) ? value.filter((entry) => typeof entry === 'string') : [];
}
function presentVehicle(vehicle) {
return {
...vehicle,
pickupLocations: normalizeLocations(vehicle?.pickupLocations),
allowDifferentDropoff: Boolean(vehicle?.allowDifferentDropoff),
dropoffLocations: normalizeLocations(vehicle?.dropoffLocations),
};
}
function presentVehicleList(vehicles, meta) {
return { data: vehicles, ...meta };
}
//# sourceMappingURL=vehicle.presenter.js.map