archetecture security fix
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"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
|
||||
Reference in New Issue
Block a user