Skip to content

util._extendo to Object.assign() #402

@fernandofas

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.

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