From 3c670cb15d9157f99eee53cdfdb25caf55a64531 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Tue, 31 Oct 2023 12:43:12 +0200 Subject: [PATCH] util: runtime deprecation util.isBuffer 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 b5b82cace3a3ad..d026ed55ac5641 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1011,6 +1011,9 @@ The [`util.isBoolean()`][] API is deprecated. -Type: Documentation-only +Type: Runtime The [`util.isBuffer()`][] API is deprecated. Please use [`Buffer.isBuffer()`][] instead. diff --git a/lib/util.js b/lib/util.js index 91485e305305e9..82ae63eb841d53 100644 --- a/lib/util.js +++ b/lib/util.js @@ -394,7 +394,9 @@ module.exports = { isBoolean: deprecate(isBoolean, 'The `util.isBoolean` API is deprecated. Please use `typeof arg === "boolean"` instead.', 'DEP0045'), - isBuffer: deprecate(isBuffer, 'The `util.isBuffer API is deprecated.', 'DEP0046'), + isBuffer: deprecate(isBuffer, + 'The `util.isBuffer` API is deprecated. Please use `Buffer.isBuffer()` instead.', + 'DEP0046'), isDeepStrictEqual(a, b) { if (internalDeepEqual === undefined) { internalDeepEqual = require('internal/util/comparisons')