Skip to content

util._extendo to Object.assign()#402

Description

@fernandofas

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch spdy@4.0.2 for the project I'm working on.

However, I had a deprecation warning where some code is calling the API util._extend, which is deprecated. Replace should be Object.assign().

Here is the diff that solved my problem:

diff --git a/node_modules/spdy/lib/spdy/agent.js b/node_modules/spdy/lib/spdy/agent.js
index 4adc524..19153a4 100644
--- a/node_modules/spdy/lib/spdy/agent.js
+++ b/node_modules/spdy/lib/spdy/agent.js
@@ -8,10 +8,8 @@ var util = require('util')
 var transport = require('spdy-transport')
 var debug = require('debug')('spdy:client')
 
-// Node.js 0.10 and 0.12 support
-Object.assign = process.versions.modules >= 46
-  ? Object.assign // eslint-disable-next-line
-  : util._extend
+// Avoid deprecated util._extend; always use native Object.assign
+Object.assign = Object.assign
 
 var EventEmitter = require('events').EventEmitter
 

This issue body was partially generated by patch-package.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions