File: index.js

package info (click to toggle)
node-is-promise 4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 124 kB
  • sloc: javascript: 61; makefile: 2
file content (6 lines) | stat: -rw-r--r-- 201 bytes parent folder | download
1
2
3
4
5
6
module.exports = isPromise;
module.exports.default = isPromise;

function isPromise(obj) {
  return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}