Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

index.js 825B

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. const os = require('os');
  3. const nameMap = new Map([
  4. [20, ['Big Sur', '11']],
  5. [19, ['Catalina', '10.15']],
  6. [18, ['Mojave', '10.14']],
  7. [17, ['High Sierra', '10.13']],
  8. [16, ['Sierra', '10.12']],
  9. [15, ['El Capitan', '10.11']],
  10. [14, ['Yosemite', '10.10']],
  11. [13, ['Mavericks', '10.9']],
  12. [12, ['Mountain Lion', '10.8']],
  13. [11, ['Lion', '10.7']],
  14. [10, ['Snow Leopard', '10.6']],
  15. [9, ['Leopard', '10.5']],
  16. [8, ['Tiger', '10.4']],
  17. [7, ['Panther', '10.3']],
  18. [6, ['Jaguar', '10.2']],
  19. [5, ['Puma', '10.1']]
  20. ]);
  21. const macosRelease = release => {
  22. release = Number((release || os.release()).split('.')[0]);
  23. const [name, version] = nameMap.get(release);
  24. return {
  25. name,
  26. version
  27. };
  28. };
  29. module.exports = macosRelease;
  30. // TODO: remove this in the next major version
  31. module.exports.default = macosRelease;