index.js 282 B

12345678910111213
  1. 'use strict';
  2. const isObject = value => value !== null &&
  3. (typeof value === 'object' || typeof value === 'function');
  4. module.exports = value => (
  5. value instanceof Promise ||
  6. (
  7. isObject(value) &&
  8. typeof value.then === 'function' &&
  9. typeof value.catch === 'function'
  10. )
  11. );