source: trip-planner-front/node_modules/caniuse-lite/dist/unpacker/region.js@ bdd6491

Last change on this file since bdd6491 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
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.