@resk/core
Version:
An innovative TypeScript framework that empowers developers to build applications with a fully decorator-based architecture for efficient resource management. By combining the power of decorators with a resource-oriented design, DecorRes enhances code cla
15 lines (14 loc) • 475 B
TypeScript
/**
* Checks if the provided value is a Promise.
*
* A value is considered a Promise if it is a native Promise or if it has a Promise-like interface.
*
* @param {any} value The value to check.
* @returns {boolean} True if the value is a Promise, false otherwise.
* @example
* ```typescript
* console.log(isPromise(Promise.resolve())); // Output: true
* console.log(isPromise({})); // Output: false
* ```
*/
export default function isPromise(value: any): boolean;