then/is-promise
### [`v4.0.0`](https://togithub.com/then/is-promise/releases/4.0.0)
[Compare Source](https://togithub.com/then/is-promise/compare/3.0.0...4.0.0)
#### Breaking Changes
- Use `PromiseLike` instead of `Promise` in TypeScript ([#40](https://togithub.com/then/is-promise/issues/40))
This is only a breaking change for TypeScript users.
In the following code:
```ts
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 `Promise`string>`when in fact it returns`PromiseLike`string>`. The latest version fixes this. If you instead had the following code, it should work exactly the same as before:
```ts
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.
### [`v3.0.0`](https://togithub.com/then/is-promise/releases/3.0.0)
[Compare Source](https://togithub.com/then/is-promise/compare/2.2.2...3.0.0)
#### Breaking Changes
- Restricted "exports" in package.json (for node 14+) ([#30](https://togithub.com/then/is-promise/issues/30))
The only ways to import this are now:
```js
import isPromise from 'is-promise';
```
or
```js
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](https://togithub.com/then/is-promise/issues/30))
If you were using ES6 style imports via
```js
import * as isPromise from 'is-promise';
```
you will need to update this to
```js
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](https://togithub.com/then/is-promise/issues/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.
Renovate configuration
:date: Schedule: "after 9pm every weekday,before 5pm every weekday" in timezone Europe/Madrid.
:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.
:recycle: Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
:no_bell: Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
2.2.2
->4.0.0
Release Notes
then/is-promise
### [`v4.0.0`](https://togithub.com/then/is-promise/releases/4.0.0) [Compare Source](https://togithub.com/then/is-promise/compare/3.0.0...4.0.0) #### Breaking Changes - Use `PromiseLike` instead of `Promise` in TypeScript ([#40](https://togithub.com/then/is-promise/issues/40)) This is only a breaking change for TypeScript users. In the following code: ```ts 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 `Promise`string>`when in fact it returns`PromiseLike`string>`. The latest version fixes this. If you instead had the following code, it should work exactly the same as before: ```ts 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. ### [`v3.0.0`](https://togithub.com/then/is-promise/releases/3.0.0) [Compare Source](https://togithub.com/then/is-promise/compare/2.2.2...3.0.0) #### Breaking Changes - Restricted "exports" in package.json (for node 14+) ([#30](https://togithub.com/then/is-promise/issues/30)) The only ways to import this are now: ```js import isPromise from 'is-promise'; ``` or ```js 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](https://togithub.com/then/is-promise/issues/30)) If you were using ES6 style imports via ```js import * as isPromise from 'is-promise'; ``` you will need to update this to ```js 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](https://togithub.com/then/is-promise/issues/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.Renovate configuration
:date: Schedule: "after 9pm every weekday,before 5pm every weekday" in timezone Europe/Madrid.
:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.
:recycle: Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
:no_bell: Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.