region.js 722 B

1234567891011121314151617181920212223242526
  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. }