Skip to content

Commit aa06db1

Browse files
authored
chore: avoid util._extend deprecation warning (#9346)
1 parent 0e00e5a commit aa06db1

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

scopes/harmony/bit/bootstrap.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const originalEmit = process.emit;
2525
// @ts-expect-error - TS complains about the return type of originalEmit.apply
2626
process.emit = function (name, data) {
2727
// --------------------------------------------
28+
29+
// 1. avoid punycode deprecation warning
30+
//
2831
// this fix is based on yarn fix for the similar issue, see code here:
2932
// https://github.com/yarnpkg/berry/blob/2cf0a8fe3e4d4bd7d4d344245d24a85a45d4c5c9/packages/yarnpkg-pnp/sources/loader/applyPatch.ts#L414-L435
3033
// ignore punycode deprecation warning
@@ -42,12 +45,21 @@ process.emit = function (name, data) {
4245
// but we don't want to override it automatically for all the users
4346
// there are many other packages (like webpack, eslint, etc) that are using this uri-js package
4447
// so if we won't ignore it, all users will get this warning
48+
//
49+
// 2. ignore util._extend deprecation warning
50+
//
51+
// this warning is coming from the http-proxy package
52+
// see: https://github.com/http-party/node-http-proxy/pull/1666
4553
if (
46-
name === `warning` &&
47-
typeof data === `object` &&
48-
((data.name === `DeprecationWarning` && data.message.includes(`punycode`)) || data.code === `DEP0040`)
54+
// filter out the warning
55+
(name === `warning` &&
56+
typeof data === `object` &&
57+
((data.name === `DeprecationWarning` && data.message.includes(`punycode`)) || data.code === `DEP0040`)) ||
58+
(data.name === `DeprecationWarning` && data.message.includes(`util._extend`)) ||
59+
data.code === `DEP0060`
4960
)
5061
return false;
62+
5163
// --------------------------------------------
5264

5365
// eslint-disable-next-line prefer-rest-params

0 commit comments

Comments
 (0)