source: imaps-frontend/node_modules/caniuse-lite/dist/unpacker/region.js

main
Last change on this file 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
RevLine 
[d565449]1'use strict'
2
3const browsers = require('./browsers').browsers
4
5function 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
21module.exports = unpackRegion
22module.exports.default = unpackRegion
Note: See TracBrowser for help on using the repository browser.