ensure-thenable.js 253 B

123456789
  1. "use strict";
  2. var safeToString = require("../safe-to-string")
  3. , isThenable = require("./is-thenable");
  4. module.exports = function (value) {
  5. if (!isThenable(value)) throw new TypeError(safeToString(value) + " is not a thenable");
  6. return value;
  7. };