index.js 1011 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. exports.default = minutesToMilliseconds;
  7. var _index = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
  8. var _index2 = require("../constants/index.js");
  9. /**
  10. * @name minutesToMilliseconds
  11. * @category Conversion Helpers
  12. * @summary Convert minutes to milliseconds.
  13. *
  14. * @description
  15. * Convert a number of minutes to a full number of milliseconds.
  16. *
  17. * @param {number} minutes - number of minutes to be converted
  18. *
  19. * @returns {number} the number of minutes converted in milliseconds
  20. * @throws {TypeError} 1 argument required
  21. *
  22. * @example
  23. * // Convert 2 minutes to milliseconds
  24. * const result = minutesToMilliseconds(2)
  25. * //=> 120000
  26. */
  27. function minutesToMilliseconds(minutes) {
  28. (0, _index.default)(1, arguments);
  29. return Math.floor(minutes * _index2.millisecondsInMinute);
  30. }
  31. module.exports = exports.default;