Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
550 bytes
|
Line | |
---|
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.