is-promise is a minimalist utility that determines if an object adheres to the Promises/A+ specification by duck-typing, specifically checking for the presence and function type of a `then` method. The package is currently at version 4.0.0, which primarily introduced a breaking change for TypeScript users regarding `PromiseLike` inference. While it doesn't follow a strict, rapid release cadence, major versions address significant compatibility updates, particularly concerning module resolution in Node.js environments and TypeScript definitions. Its key differentiator is its small footprint and focused API, providing a reliable and agnostic way to identify promise-like objects, useful in contexts where various promise implementations or thenables might be encountered, without relying on a global `Promise` constructor.
npm install is-promiseVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `isPromise` to check various values, including actual promises, custom thenables, and non-promise types, and correctly handle their resolution.
Review TypeScript code that uses `isPromise` to ensure correct type handling, especially in function return types or conditional branches, adjusting types from `Promise<T>` to `PromiseLike<T>` where appropriate.
Avoid importing or requiring any paths other than the main package entry point (`is-promise`). If you were relying on internal package files, find alternative ways to access that information (e.g., read the main `package.json` of your *own* project).
Update all ES Module imports to use the default import syntax: `import isPromise from 'is-promise';`.
Do not use `is-promise` versions 2.2.0 or 2.2.1. Upgrade to 2.2.2 or any subsequent stable version (e.g., 3.x or 4.x).
Change the import statement to use the default export: `import isPromise from 'is-promise';` (applicable for v3.0.0 and above).
Access to internal package files is no longer supported. If you need information from `is-promise`'s `package.json`, consider hardcoding it or finding another way to obtain it that doesn't involve directly accessing its internal file structure.
No dependency data recorded yet.