合同小程序前端代码仓库
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

3 months ago
  1. "use strict";
  2. function transformBrands(inputData = null) {
  3. const groups = new UTSJSONObject({});
  4. inputData.forEach((brand = null) => {
  5. const letter = brand.bfirstletter;
  6. if (!groups[letter]) {
  7. groups[letter] = [];
  8. }
  9. groups[letter].push(new UTSJSONObject({ name: brand.name, id: brand.id }));
  10. });
  11. return Object.keys(groups).sort().map((letter) => {
  12. return new UTSJSONObject({
  13. letter,
  14. cars: groups[letter]
  15. });
  16. });
  17. }
  18. exports.transformBrands = transformBrands;
  19. //# sourceMappingURL=../../.sourcemap/mp-weixin/js/airport.js.map