From e32b0c1eab97eb6227ac9cfac5755926267f291b Mon Sep 17 00:00:00 2001 From: marco-ippolito Date: Mon, 29 Apr 2024 10:29:49 +0200 Subject: [PATCH] util: move util.isBuffer to eol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/52744 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Yagiz Nizipli Reviewed-By: Matteo Collina Reviewed-By: Rafael Gonzaga Reviewed-By: Ulises Gascón Reviewed-By: Paolo Insogna Reviewed-By: Trivikram Kamat Reviewed-By: Moshe Atlow Reviewed-By: James M Snell --- doc/api/deprecations.md | 9 +++++---- doc/api/util.md | 26 -------------------------- lib/util.js | 4 ---- test/parallel/test-util.js | 4 ---- 4 files changed, 5 insertions(+), 38 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 8704611bfc9cde..1852bfadb70779 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1023,6 +1023,9 @@ The `util.isBoolean()` API has been removed. Please use -Type: Runtime +Type: End-of-Life -The [`util.isBuffer()`][] API is deprecated. Please use +The `util.isBuffer()` API has been removed. Please use [`Buffer.isBuffer()`][] instead. ### DEP0047: `util.isDate()` @@ -3779,8 +3782,6 @@ is deprecated to better align with recommendations per [NIST SP 800-38D][]. [`util.inspect()`]: util.md#utilinspectobject-options [`util.inspect.custom`]: util.md#utilinspectcustom [`util.isArray()`]: util.md#utilisarrayobject -[`util.isBuffer()`]: util.md#utilisbufferobject -[`util.isDate()`]: util.md#utilisdateobject [`util.isError()`]: util.md#utiliserrorobject [`util.isFunction()`]: util.md#utilisfunctionobject [`util.isNull()`]: util.md#utilisnullobject diff --git a/doc/api/util.md b/doc/api/util.md index 0c09cd36b70ebf..7eac4afa2c7835 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -2950,31 +2950,6 @@ util.isArray({}); // Returns: false ``` -### `util.isBuffer(object)` - - - -> Stability: 0 - Deprecated: Use [`Buffer.isBuffer()`][] instead. - -* `object` {any} -* Returns: {boolean} - -Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. - -```js -const util = require('node:util'); - -util.isBuffer({ length: 0 }); -// Returns: false -util.isBuffer([]); -// Returns: false -util.isBuffer(Buffer.from('hello world')); -// Returns: true -``` - ### `util.isDate(object)`