From 70330f5c2b53853a1dc771c307252edcc0852616 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Tue, 31 Oct 2023 12:48:45 +0200 Subject: [PATCH] util: runtime deprecate util.isFunction 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 b35e4b4e4cf0ff..cc9b69a9a98fc2 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1083,6 +1083,9 @@ instead. -Type: Documentation-only +Type: Runtime The [`util.isFunction()`][] API is deprecated. diff --git a/lib/util.js b/lib/util.js index 12b9c5d7c670c5..00b132934d9b32 100644 --- a/lib/util.js +++ b/lib/util.js @@ -437,7 +437,9 @@ module.exports = { 'Please use `ObjectPrototypeToString(e) === "[object Error]" ' + '|| e instanceof Error` instead.', 'DEP0048'), - isFunction: deprecate(isFunction, 'The `util.isFunction API is deprecated.', 'DEP0049'), + isFunction: deprecate(isFunction, + 'The `util.isFunction` API is deprecated. Please use `typeof arg === "function"` instead.', + 'DEP0049'), isPrimitive: deprecate(isPrimitive, 'The `util.isPrimitive API is deprecated.', 'DEP0054'), log: deprecate(log, 'The `util.log API is deprecated.', 'DEP0059'), promisify,