@web3r/flowerkit
Version:
A collection of more than 60 often used utility JS functions that simplify frontend development.
14 lines (13 loc) • 402 B
JavaScript
/**
* Checks if an object is promise
* @param obj{*} - source object
* @return {boolean}
* @example
* // How to check if an object is promise?
* const obj = new Promise();
* const isPromise = isObjPromise(obj);
* console.log(isPromise); // => true
*
*/
const isObjPromise=obj=>!!obj&&typeof obj==="object"&&typeof obj.then==="function";export{isObjPromise};
//# sourceMappingURL=index.js.map