valid-timeout.js 288 B

12345678910
  1. "use strict";
  2. var toPosInt = require("es5-ext/number/to-pos-integer")
  3. , maxTimeout = require("./max-timeout");
  4. module.exports = function (value) {
  5. value = toPosInt(value);
  6. if (value > maxTimeout) throw new TypeError(value + " exceeds maximum possible timeout");
  7. return value;
  8. };