Skip to content

Commit 7c65dd0

Browse files
committed
remove extend dependency
Use `Object.assign()` instead.
1 parent bdad2dc commit 7c65dd0

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

https-proxy-agent.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
var net = require('net');
77
var tls = require('tls');
88
var url = require('url');
9-
var extend = require('extend');
109
var Agent = require('agent-base');
1110
var inherits = require('util').inherits;
1211
var debug = require('debug')('https-proxy-agent');
@@ -31,7 +30,7 @@ function HttpsProxyAgent (opts) {
3130
debug('creating new HttpsProxyAgent instance: %o', opts);
3231
Agent.call(this, connect);
3332

34-
var proxy = extend({}, opts);
33+
var proxy = Object.assign({}, opts);
3534

3635
// if `true`, then connect to the proxy server over TLS. defaults to `false`.
3736
this.secureProxy = proxy.protocol ? /^https:?$/i.test(proxy.protocol) : false;
@@ -192,7 +191,7 @@ function connect (req, opts, fn) {
192191
var hostname = opts.host + ':' + opts.port;
193192
var msg = 'CONNECT ' + hostname + ' HTTP/1.1\r\n';
194193

195-
var headers = extend({}, proxy.headers);
194+
var headers = Object.assign({}, proxy.headers);
196195
if (proxy.auth) {
197196
headers['Proxy-Authorization'] = 'Basic ' + new Buffer(proxy.auth).toString('base64');
198197
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
},
2424
"dependencies": {
2525
"agent-base": "2",
26-
"debug": "^2.4.1",
27-
"extend": "3"
26+
"debug": "^2.4.1"
2827
},
2928
"devDependencies": {
3029
"mocha": "2",

0 commit comments

Comments
 (0)