Skip to content

Commit

Permalink
chore(release): 6.0.0 [skip ci]
Browse files Browse the repository at this point in the history
# [6.0.0](v5.0.0...v6.0.0) (2022-08-11)

### Bug Fixes

* Update typescript types to use modules instead of export=. ([a9cdb29](a9cdb29))

### BREAKING CHANGES

* For 99% of users, this should have no effect, but I'll bump the major version just to be safe.
  • Loading branch information
semantic-release-bot committed Aug 11, 2022
1 parent 302c9ce commit d37a417
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 84 deletions.
169 changes: 86 additions & 83 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,113 @@
# [5.0.0](https://github.com/jwalton/node-promise-breaker/compare/v4.1.13...v5.0.0) (2019-06-25)
# [6.0.0](https://github.com/jwalton/node-promise-breaker/compare/v5.0.0...v6.0.0) (2022-08-11)

### Bug Fixes

- Update typescript types to use modules instead of export=. ([a9cdb29](https://github.com/jwalton/node-promise-breaker/commit/a9cdb2950a365e51b60985ee417109534a9365e1))

* feat(Drop support for node v6 and node v8.): ([187b75d](https://github.com/jwalton/node-promise-breaker/commit/187b75d))
### BREAKING CHANGES

- For 99% of users, this should have no effect, but I'll bump the major version just to be safe.

# [5.0.0](https://github.com/jwalton/node-promise-breaker/compare/v4.1.13...v5.0.0) (2019-06-25)

- feat(Drop support for node v6 and node v8.): ([187b75d](https://github.com/jwalton/node-promise-breaker/commit/187b75d))

### BREAKING CHANGES

* Drop support for node v6 and node v8.
- Drop support for node v6 and node v8.

## [4.1.13](https://github.com/jwalton/node-promise-breaker/compare/v4.1.12...v4.1.13) (2018-11-29)


### Bug Fixes

* Fix typescript def for addPromise. ([fa4fb38](https://github.com/jwalton/node-promise-breaker/commit/fa4fb38))
- Fix typescript def for addPromise. ([fa4fb38](https://github.com/jwalton/node-promise-breaker/commit/fa4fb38))

## [4.1.12](https://github.com/jwalton/node-promise-breaker/compare/v4.1.11...v4.1.12) (2018-11-29)


### Bug Fixes

* Better typescript definitions. ([604b106](https://github.com/jwalton/node-promise-breaker/commit/604b106))
- Better typescript definitions. ([604b106](https://github.com/jwalton/node-promise-breaker/commit/604b106))

<a name="4.1.11"></a>
## [4.1.11](https://github.com/jwalton/node-promise-breaker/compare/v4.1.10...v4.1.11) (2018-05-07)

## [4.1.11](https://github.com/jwalton/node-promise-breaker/compare/v4.1.10...v4.1.11) (2018-05-07)

### Bug Fixes

* **typescript:** Add generic to `addPromise()`. ([de41bf2](https://github.com/jwalton/node-promise-breaker/commit/de41bf2))

v4.1.10
-------

* Add typescript support.

v4.1.4
------
* Remove accidental ES6. :)

v4.1.3
------
* Support async/await functions.

v4.1.2
------
* Relaxed rules for `apply()`, `call()`, and friends. These used to require a
function that took exactly `n` arguments or `n+1` arguments (the Promise and
the callback cases, respectively). These functions now also accept
functions with fewer parameters that return a Promise (possibly the function
you're calling into doesn't care about some of the parameters you are
passing).

v4.1.1
------
* Correctly handle exceptions from callbacks - convert into uncaught exceptions
instead of unhandled rejections.

v4.1.0
------
* Added `callWithCb()`, `addPromise()`, and `addCallback()`.
* Added `args` parameter to `make()` and `break()`.
* Remove node v4 and v5 from the travis tests, so we can write tests in ES6 syntax.
* Convert tests to javascript, remove dev dependency on coffee-script.

v4.0.3
------
Roll back v4.0.2. If someone passes in a strange function that relies on
- **typescript:** Add generic to `addPromise()`. ([de41bf2](https://github.com/jwalton/node-promise-breaker/commit/de41bf2))

## v4.1.10

- Add typescript support.

## v4.1.4

- Remove accidental ES6. :)

## v4.1.3

- Support async/await functions.

## v4.1.2

- Relaxed rules for `apply()`, `call()`, and friends. These used to require a
function that took exactly `n` arguments or `n+1` arguments (the Promise and
the callback cases, respectively). These functions now also accept
functions with fewer parameters that return a Promise (possibly the function
you're calling into doesn't care about some of the parameters you are
passing).

## v4.1.1

- Correctly handle exceptions from callbacks - convert into uncaught exceptions
instead of unhandled rejections.

## v4.1.0

- Added `callWithCb()`, `addPromise()`, and `addCallback()`.
- Added `args` parameter to `make()` and `break()`.
- Remove node v4 and v5 from the travis tests, so we can write tests in ES6 syntax.
- Convert tests to javascript, remove dev dependency on coffee-script.

## v4.0.3

Roll back v4.0.2. If someone passes in a strange function that relies on
`arguments`, then we'd throw an error fail in v4.0.0, but we do completely the
wrong thing in v4.0.2.

v4.0.2
------
Relax error conditions for `callFn()` and `applyFn()`. If a function is passed
## v4.0.2

Relax error conditions for `callFn()` and `applyFn()`. If a function is passed
that takes too few parameters, we assume it is Promise based.

v4.0.0
------

* Add `call()` and `apply()`.
* Breaking Change - Previously, when using `pb.callFn()` or `pb.applyFn()`, if
the called function returned a thenable, we would assume the function was
Promise based, and would otherwise assume it was callback based. This leads
to a dangerous problem if you call a function that returns a scalar, though:

let fn = (str) => "hello " + str;
pb.callFn(fn, 1, null, "world")
.then(result => expect(result).to.equal("hello world"));

Here, `fn.length` is 1, and we're telling `callFn` we want to call an async
function that takes 1 parameter, not including the callback. If `fn`
doesn't return a Promise here, the expected behavior would be to wrap the
return value in a Promise and return it. In v3.0.0, we would have assumed
that since `fn` did not return a Promise, it must be callback based, so we
would wait for the callback forever. This is dangerous behavior.

In v4.0.0, we now decide whether to treat `fn` as a Promise function or a
callback function based on `fn.length`. If you call `callFn` or `applyFn`,
and tell it you are expecting a function that takes 1 parameter,
promise-breaker will now throw an error if `fn` does not take 1 or 2
parameters.

v3.0.0
------

* Breaking Change - When using `pb.make(fn)`, if `fn` passes more than two
arguments to its callback, then these arguments will be transformed into an
array and passed to the Promise. Previous versions would only ever return
the first value passed to the callback.
## v4.0.0

- Add `call()` and `apply()`.
- Breaking Change - Previously, when using `pb.callFn()` or `pb.applyFn()`, if
the called function returned a thenable, we would assume the function was
Promise based, and would otherwise assume it was callback based. This leads
to a dangerous problem if you call a function that returns a scalar, though:

let fn = (str) => "hello " + str;
pb.callFn(fn, 1, null, "world")
.then(result => expect(result).to.equal("hello world"));

Here, `fn.length` is 1, and we're telling `callFn` we want to call an async
function that takes 1 parameter, not including the callback. If `fn`
doesn't return a Promise here, the expected behavior would be to wrap the
return value in a Promise and return it. In v3.0.0, we would have assumed
that since `fn` did not return a Promise, it must be callback based, so we
would wait for the callback forever. This is dangerous behavior.

In v4.0.0, we now decide whether to treat `fn` as a Promise function or a
callback function based on `fn.length`. If you call `callFn` or `applyFn`,
and tell it you are expecting a function that takes 1 parameter,
promise-breaker will now throw an error if `fn` does not take 1 or 2
parameters.

## v3.0.0

- Breaking Change - When using `pb.make(fn)`, if `fn` passes more than two
arguments to its callback, then these arguments will be transformed into an
array and passed to the Promise. Previous versions would only ever return
the first value passed to the callback.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "promise-breaker",
"version": "5.0.0",
"version": "6.0.0",
"description": "Library to help write libraries that accept both promises and callbacks.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit d37a417

Please sign in to comment.