index.js 755 B

1234567891011121314151617181920212223242526
  1. var versions = require('./versions');
  2. var fullVersions = require('./versions');
  3. var electronToChromium = function (query) {
  4. var number = getQueryString(query);
  5. return number.split('.').length > 2 ? fullVersions[number] : versions[number] || undefined;
  6. }
  7. var electronToBrowserList = function (query) {
  8. var number = getQueryString(query);
  9. return versions[number] ? "Chrome >= " + versions[number] : undefined;
  10. }
  11. var getQueryString = function (query) {
  12. var number = query;
  13. if (query === 1) { number = "1.0" }
  14. if (typeof query === 'number') { number += ''; }
  15. return number;
  16. }
  17. module.exports = {
  18. versions: versions,
  19. fullVersions: fullVersions,
  20. electronToChromium: electronToChromium,
  21. electronToBrowserList: electronToBrowserList
  22. };