合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

19 lines
575 B

"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