UNPKG

@web3r/flowerkit

Version:

Tree-shakable JavaScript and TypeScript utility library for frontend/browser apps: DOM, events, arrays, objects, strings, date, JSON, and network helpers (ESM/CJS, SSR-friendly).

13 lines (12 loc) 407 B
/** * Checks if an object is promise * @param obj{*} source object * @returns {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.mjs.map