function isPromise(x) {
  if (!x) return false
  return !!(!isUndefined(Promise) && x instanceof Promise || x.then && isFunction(x.then))
}
Returns true if the input is a Promise.
@param {*} x - The input to test
@returns {boolean}