ensure-time-value.js 325B

1234567891011
  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. };