NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #681 most downloaded on npm
Test whether an object looks like a promises-a+ promise
Last release 6 years ago
no release in 18 months
Release timing varies
gaps range from 7 months to 4.6 years
Some releases are documented
notes for 5 of 9 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
9 releases · first in 2012
This is only a breaking change for TypeScript users.
Use PromiseLike instead of Promise in TypeScript (#40)
This is only a breaking change for TypeScript users.
In the following code:
function foo(x: PromiseLike<string> | string) {
if (isPromise(x)) {
return x;
} else {
return Promise.resolve(x);
}
}TypeScript would previously have incorrectly inferred foo as returning Promisestring>when in fact it returnsPromiseLikestring>. The latest version fixes this. If you instead had the following code, it should work exactly the same as before:
function foo(x: Promise<string> | string) {
if (isPromise(x)) {
return x;
} else {
return Promise.resolve(x);
}
}This update is to reflect the fact that is-promise does "duck" typing, rather than an instanceof check.
One column per quarter.
Restricted "exports" in package.json (for node 14+)
Restricted "exports" in package.json (for node 14+) (#30)
The only ways to import this are now:
import isPromise from 'is-promise';or
const isPromise = require('is-promise');If you were requiring things like the package.json file within the package, these are not part of the public API, and will no longer be accessible.
is-promise now uses "default" exports in ES Modules environments (#30)
If you were using ES6 style imports via
import * as isPromise from 'is-promise';you will need to update this to
import isPromise from 'is-promise';If you were using CommonJS style require, no change is needed.
This package now comes bundled with TypeScript definitions (#31)
This means you may get new errors that you didn't see before if you are using TypeScript. If you are not using TypeScript, this change will not impact you.
Removed ESM support that was added in 2.2.0 as it turns out to be a breaking change (see #20 )
Removed ESM support that was added in 2.2.0 as it turns out to be a breaking change (see #20)
Attempted to fix ESM, but this is still broken for people who import the package.json file.
Attempted to fix ESM, but this is still broken for people who import the package.json file.
Adds support for ES Module style default import
This version of is-promse is broken. Please use 2.2.2
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →