main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
550 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | const browsers = require('./browsers').browsers
|
---|
| 4 |
|
---|
| 5 | function unpackRegion(packed) {
|
---|
| 6 | return Object.keys(packed).reduce((list, browser) => {
|
---|
| 7 | let data = packed[browser]
|
---|
| 8 | list[browsers[browser]] = Object.keys(data).reduce((memo, key) => {
|
---|
| 9 | let stats = data[key]
|
---|
| 10 | if (key === '_') {
|
---|
| 11 | stats.split(' ').forEach(version => (memo[version] = null))
|
---|
| 12 | } else {
|
---|
| 13 | memo[key] = stats
|
---|
| 14 | }
|
---|
| 15 | return memo
|
---|
| 16 | }, {})
|
---|
| 17 | return list
|
---|
| 18 | }, {})
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | module.exports = unpackRegion
|
---|
| 22 | module.exports.default = unpackRegion
|
---|
Note:
See
TracBrowser
for help on using the repository browser.