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.

25 lines
722 B

4 years ago
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = unpackRegion;
  6. var _browsers = require('./browsers');
  7. function unpackRegion(packed) {
  8. return Object.keys(packed).reduce(function (list, browser) {
  9. var data = packed[browser];
  10. list[_browsers.browsers[browser]] = Object.keys(data).reduce(function (memo, key) {
  11. var stats = data[key];
  12. if (key === '_') {
  13. stats.split(' ').forEach(function (version) {
  14. return memo[version] = null;
  15. });
  16. } else {
  17. memo[key] = stats;
  18. }
  19. return memo;
  20. }, {});
  21. return list;
  22. }, {});
  23. }