From 22d8062e42aa1314a69b5b10427c828653e82da9 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Tue, 31 Oct 2023 12:22:30 +0200 Subject: [PATCH] util: runtime deprecation util._extend PR-URL: https://github.com/nodejs/node/pull/50488 Reviewed-By: Rafael Gonzaga Reviewed-By: Yagiz Nizipli Reviewed-By: Robert Nagy Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Joyee Cheung --- doc/api/deprecations.md | 5 ++++- lib/util.js | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 695f07fd42da75..1f2de2ed373d2f 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1282,6 +1282,9 @@ The [`util.log()`][] API is deprecated. -Type: Documentation-only +Type: Runtime The [`util._extend()`][] API is deprecated. diff --git a/lib/util.js b/lib/util.js index 9ddb332f866355..e1f005369d5873 100644 --- a/lib/util.js +++ b/lib/util.js @@ -375,7 +375,9 @@ function _exceptionWithHostPort(...args) { module.exports = { _errnoException, _exceptionWithHostPort, - _extend, + _extend: deprecate(_extend, + 'The `util._extend` API is deprecated. Please use Object.assign() instead.', + 'DEP0060'), callbackify, debug: debuglog, debuglog,