Refactor code structure for improved readability and maintainability

This commit is contained in:
2026-02-03 00:13:31 +00:00
parent 46ebe81379
commit 64e3aacf0c
2373 changed files with 904760 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
'use strict'
const browsers = require('./browsers').browsers
function unpackRegion(packed) {
return Object.keys(packed).reduce((list, browser) => {
let data = packed[browser]
list[browsers[browser]] = Object.keys(data).reduce((memo, key) => {
let stats = data[key]
if (key === '_') {
stats.split(' ').forEach(version => (memo[version] = null))
} else {
memo[key] = stats
}
return memo
}, {})
return list
}, {})
}
module.exports = unpackRegion
module.exports.default = unpackRegion