code: function isPromise(input) {
  	return (
  		(
  			typeof Promise !== 'undefined' &&
  			input instanceof Promise
  		) ||
  		(
  			input !== null &&
  			typeof input === 'object' &&
  			typeof input.then === 'function' &&
  			typeof input.catch === 'function'
  		)
  	);
  }
docs: Taken from here and modified for better browser support https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js