Skip to content

Commit

Permalink
fix: use Object.assign (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed May 8, 2024
1 parent 1b8393d commit d1e789f
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 85 deletions.
26 changes: 0 additions & 26 deletions .autod.conf

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/nodejs.yml
@@ -0,0 +1,46 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches:
- main
- master
- 3.x
pull_request:
branches:
- main
- master
- 3.x

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [4, 6, 8, 10]
os: [ubuntu-latest]

steps:
- name: Checkout Git Source
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm i -g npminstall@5 && npminstall

- name: Continuous Integration
run: npm run ci

- name: Code Coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

17 changes: 0 additions & 17 deletions appveyor.yml

This file was deleted.

17 changes: 0 additions & 17 deletions circle.yml

This file was deleted.

10 changes: 5 additions & 5 deletions lib/_http_agent.js
Expand Up @@ -51,7 +51,7 @@ function Agent(options) {
self.defaultPort = 80;
self.protocol = 'http:';

self.options = util._extend({}, options);
self.options = Object.assign({}, options);

// don't confuse net and make it think that we're connecting to a pipe
self.options.path = null;
Expand Down Expand Up @@ -193,8 +193,8 @@ Agent.prototype.addRequest = function addRequest(req, options, port/*legacy*/,
};
}

options = util._extend({}, options);
options = util._extend(options, this.options);
options = Object.assign({}, options);
options = Object.assign(options, this.options);

if (!options.servername)
options.servername = calculateServerName(options, req);
Expand Down Expand Up @@ -250,8 +250,8 @@ Agent.prototype.addRequest = function addRequest(req, options, port/*legacy*/,

Agent.prototype.createSocket = function createSocket(req, options, cb) {
var self = this;
options = util._extend({}, options);
options = util._extend(options, self.options);
options = Object.assign({}, options);
options = Object.assign(options, self.options);

if (!options.servername)
options.servername = calculateServerName(options, req);
Expand Down
8 changes: 1 addition & 7 deletions package.json
Expand Up @@ -14,8 +14,7 @@
"test": "egg-bin test",
"cov": "egg-bin cov",
"ci": "npm run lint && npm run cov",
"lint": "eslint lib test index.js",
"autod": "autod"
"lint": "eslint lib test index.js"
},
"repository": {
"type": "git",
Expand All @@ -35,19 +34,14 @@
"humanize-ms": "^1.2.1"
},
"devDependencies": {
"autod": "^3.0.1",
"egg-bin": "^1.11.1",
"egg-ci": "^1.8.0",
"eslint": "^4.19.1",
"eslint-config-egg": "^6.0.0",
"pedding": "^1.1.0"
},
"engines": {
"node": ">= 4.0.0"
},
"ci": {
"version": "4, 6, 8, 10"
},
"publishConfig": {
"tag": "latest-3"
},
Expand Down

0 comments on commit d1e789f

Please sign in to comment.