Source: extern/version.js

  1. import register from "../util/register.js";
  2. import * as m_version from "../intern/version.js";
  3. /**
  4. * Version API. Allows to query various information about the current release.
  5. * @module version
  6. */
  7. function Version(ns, exports) {
  8. /**
  9. * Get the version.
  10. * The version is an array of the format: [yy, mm] or [yy, mm, bugfix] for "RELEASE"
  11. * version or [yy, mm] for "DEBUG" version.
  12. * @method module:version.version
  13. * @returns {Array} Version: [yy, mm]
  14. */
  15. exports.version = m_version.version;
  16. /**
  17. * Get the version.
  18. * The version string has the format: "yy.mm" or "yy.mm.bugfix" for "RELEASE"
  19. * version or "yy.mm" for "DEBUG" version.
  20. * @method module:version.version_str
  21. * @returns {string} Version string
  22. */
  23. exports.version_str = m_version.version_str;
  24. /**
  25. * Get the release type: "DEBUG" or "RELEASE".
  26. * @method module:version.type
  27. * @returns {string} Release type
  28. */
  29. exports.type = m_version.type;
  30. /**
  31. * Return the build date or the current date for the "DEBUG" version.
  32. * @method module:version.date
  33. * @returns {Date} Date
  34. */
  35. exports.date = m_version.date;
  36. /**
  37. * Return the build date or the current date for the "DEBUG" version.
  38. * @method module:version.date_str
  39. * @returns {string} Date string in the format: "dd.mm.yyyy hh.mm.ss"
  40. */
  41. exports.date_str = m_version.date_str;
  42. /**
  43. * Returns a string representing the application version based on build time.
  44. * Returns the current timestamp in the "DEBUG" mode.
  45. * @method module:version.get_build_version
  46. * @returns {string} Build version.
  47. */
  48. exports.get_build_version = m_version.get_build_version;
  49. }
  50. var version_factory = register("version", Version);
  51. export default version_factory;