asarfuckery/electronasar/canary/common/api/is-promise.js
2019-01-17 19:00:12 +01:00

14 lines
320 B
JavaScript

'use strict'
module.exports = function isPromise (val) {
return (
val &&
val.then &&
val.then instanceof Function &&
val.constructor &&
val.constructor.reject &&
val.constructor.reject instanceof Function &&
val.constructor.resolve &&
val.constructor.resolve instanceof Function
)
}