1 | var versions = require('./versions');
|
---|
2 | var fullVersions = require('./full-versions');
|
---|
3 | var chromiumVersions = require('./chromium-versions');
|
---|
4 | var fullChromiumVersions = require('./full-chromium-versions');
|
---|
5 |
|
---|
6 | var electronToChromium = function (query) {
|
---|
7 | var number = getQueryString(query);
|
---|
8 | return number.split('.').length > 2 ? fullVersions[number] : versions[number] || undefined;
|
---|
9 | };
|
---|
10 |
|
---|
11 | var chromiumToElectron = function (query) {
|
---|
12 | var number = getQueryString(query);
|
---|
13 | return number.split('.').length > 2 ? fullChromiumVersions[number] : chromiumVersions[number] || undefined;
|
---|
14 | };
|
---|
15 |
|
---|
16 | var electronToBrowserList = function (query) {
|
---|
17 | var number = getQueryString(query);
|
---|
18 | return versions[number] ? "Chrome >= " + versions[number] : undefined;
|
---|
19 | };
|
---|
20 |
|
---|
21 | var getQueryString = function (query) {
|
---|
22 | var number = query;
|
---|
23 | if (query === 1) { number = "1.0" }
|
---|
24 | if (typeof query === 'number') { number += ''; }
|
---|
25 | return number;
|
---|
26 | };
|
---|
27 |
|
---|
28 | module.exports = {
|
---|
29 | versions: versions,
|
---|
30 | fullVersions: fullVersions,
|
---|
31 | chromiumVersions: chromiumVersions,
|
---|
32 | fullChromiumVersions: fullChromiumVersions,
|
---|
33 | electronToChromium: electronToChromium,
|
---|
34 | electronToBrowserList: electronToBrowserList,
|
---|
35 | chromiumToElectron: chromiumToElectron
|
---|
36 | };
|
---|