ensure-time-value.js 325 B

12345678910
  1. "use strict";
  2. var safeToString = require("../safe-to-string")
  3. , toInteger = require("../number/to-integer")
  4. , isTimeValue = require("./is-time-value");
  5. module.exports = function (value) {
  6. if (isTimeValue(value)) return toInteger(value);
  7. throw new TypeError(safeToString(value) + " is not a valid time value");
  8. };