ensure-promise.js 250 B

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