diff options
author | Dimitri Staessens <[email protected]> | 2019-10-06 21:37:45 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2019-10-06 21:37:45 +0200 |
commit | 3c51c3be85bb0d1bdb87ea0d6632f1c256912f27 (patch) | |
tree | c7ccc8279b12c4f7bdbbb4270d617e48f51722e4 /node_modules/caniuse-lite/dist/unpacker/agents.js | |
parent | 412c104bebc507bea9c94fd53b5bdc4b64cbfe31 (diff) | |
download | website-3c51c3be85bb0d1bdb87ea0d6632f1c256912f27.tar.gz website-3c51c3be85bb0d1bdb87ea0d6632f1c256912f27.zip |
build: Add some required modules for node
Diffstat (limited to 'node_modules/caniuse-lite/dist/unpacker/agents.js')
-rw-r--r-- | node_modules/caniuse-lite/dist/unpacker/agents.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/node_modules/caniuse-lite/dist/unpacker/agents.js b/node_modules/caniuse-lite/dist/unpacker/agents.js new file mode 100644 index 0000000..8dc5d49 --- /dev/null +++ b/node_modules/caniuse-lite/dist/unpacker/agents.js @@ -0,0 +1,51 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.agents = undefined; + +var _browsers = require('./browsers'); + +var _browserVersions = require('./browserVersions'); + +var agentsData = require('../../data/agents'); + +function unpackBrowserVersions(versionsData) { + return Object.keys(versionsData).reduce(function (usage, version) { + usage[_browserVersions.browserVersions[version]] = versionsData[version]; + return usage; + }, {}); +} + +var agents = exports.agents = Object.keys(agentsData).reduce(function (map, key) { + var versionsData = agentsData[key]; + map[_browsers.browsers[key]] = Object.keys(versionsData).reduce(function (data, entry) { + if (entry === 'A') { + data.usage_global = unpackBrowserVersions(versionsData[entry]); + } else if (entry === 'C') { + data.versions = versionsData[entry].reduce(function (list, version) { + if (version === '') { + list.push(null); + } else { + list.push(_browserVersions.browserVersions[version]); + } + return list; + }, []); + } else if (entry === 'D') { + data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]); + } else if (entry === 'E') { + data.browser = versionsData[entry]; + } else if (entry === 'F') { + data.release_date = Object.keys(versionsData[entry]).reduce(function (map, key) { + map[_browserVersions.browserVersions[key]] = versionsData[entry][key]; + return map; + }, {}); + } else { + // entry is B + data.prefix = versionsData[entry]; + } + return data; + }, {}); + return map; +}, {});
\ No newline at end of file |