is-promise
isPromise(obj)
Determines if object is a Promise.
var isPromise = require("can-util/js/is-promise/is-promise");
var promise = new Promise(function(resolve){
resolve();
});
console.log(isPromise(promise)); // -> true
console.log(isPromise("foo bar")); // -> false
Parameters
- obj
{Object}
:An object to be tested.
Returns
{Boolean}
:
True if the object is a Promise.