_assertPromise.js 274 B

1234567
  1. import _isFunction from "./_isFunction.js";
  2. import _toString from "./_toString.js";
  3. export default function _assertPromise(name, p) {
  4. if (p == null || !_isFunction(p.then)) {
  5. throw new TypeError('`' + name + '` expected a Promise, received ' + _toString(p, []));
  6. }
  7. }