From bd559e3e5a0748c19334ad94fa69d28ebb90d01f Mon Sep 17 00:00:00 2001 From: marco-ippolito Date: Mon, 29 Apr 2024 11:07:03 +0200 Subject: [PATCH] util: move util.isObject 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 | 8 +++++--- doc/api/util.md | 30 ------------------------------ lib/util.js | 13 ------------- test/parallel/test-util.js | 7 ------- 4 files changed, 5 insertions(+), 53 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 989e49408daa93..a2448ea270a3bf 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1204,6 +1204,9 @@ The `util.isNumber()` API has been removed. Please use -Type: Runtime +Type: End-of-Life -The [`util.isObject()`][] API is deprecated. Please use +The `util.isObject()` API has been removed. Please use `arg && typeof arg === 'object'` instead. ### DEP0054: `util.isPrimitive()` @@ -3805,7 +3808,6 @@ is deprecated to better align with recommendations per [NIST SP 800-38D][]. [`util.isArray()`]: util.md#utilisarrayobject [`util.isError()`]: util.md#utiliserrorobject [`util.isFunction()`]: util.md#utilisfunctionobject -[`util.isObject()`]: util.md#utilisobjectobject [`util.isPrimitive()`]: util.md#utilisprimitiveobject [`util.log()`]: util.md#utillogstring [`util.promisify`]: util.md#utilpromisifyoriginal diff --git a/doc/api/util.md b/doc/api/util.md index cbf56074bb9945..6fd5a824b43f8b 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -3045,36 +3045,6 @@ util.isFunction(Bar); // Returns: true ``` -### `util.isObject(object)` - - - -> Stability: 0 - Deprecated: -> Use `value !== null && typeof value === 'object'` instead. - -* `object` {any} -* Returns: {boolean} - -Returns `true` if the given `object` is strictly an `Object` **and** not a -`Function` (even though functions are objects in JavaScript). -Otherwise, returns `false`. - -```js -const util = require('node:util'); - -util.isObject(5); -// Returns: false -util.isObject(null); -// Returns: false -util.isObject({}); -// Returns: true -util.isObject(() => {}); -// Returns: false -``` - ### `util.isPrimitive(object)`