"use strict";
|
|
function transformBrands(inputData = null) {
|
|
const groups = new UTSJSONObject({});
|
|
inputData.forEach((brand = null) => {
|
|
const letter = brand.bfirstletter;
|
|
if (!groups[letter]) {
|
|
groups[letter] = [];
|
|
}
|
|
groups[letter].push(new UTSJSONObject({ name: brand.name, id: brand.id }));
|
|
});
|
|
return Object.keys(groups).sort().map((letter) => {
|
|
return new UTSJSONObject({
|
|
letter,
|
|
cars: groups[letter]
|
|
});
|
|
});
|
|
}
|
|
exports.transformBrands = transformBrands;
|
|
//# sourceMappingURL=../../.sourcemap/mp-weixin/js/airport.js.map
|