Skip to content

Commit

Permalink
fix: remove dependency on when in favor of native Promises
Browse files Browse the repository at this point in the history
when is a peculiar library that cannot be bundled by tools like esbuild.
Additionally, Promise implementations are available in all currently supported
Node releases, so we can remove this dependency whithout impacting user ability
to override `promiseFactory`.
  • Loading branch information
markandrus committed Aug 18, 2021
1 parent a1189ef commit 52d0603
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*
*/
var extend = require('extend');
var when = require('when');
var request = require('request');
var RetryStrategies = require('./strategies');
var _ = require('lodash');
Expand All @@ -22,7 +21,7 @@ var DEFAULTS = {

// Default promise factory which use bluebird
function defaultPromiseFactory(resolver) {
return when.promise(resolver);
return new Promise(resolver);
}

function _cloneOptions(options) {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
},
"dependencies": {
"extend": "^3.0.2",
"lodash": "^4.17.15",
"when": "^3.7.7"
"lodash": "^4.17.15"
},
"peerDependencies": {
"request": "2.*.*"
Expand Down

0 comments on commit 52d0603

Please sign in to comment.