From 05e72c939a4098c3a7861ab86b41553ffc916603 Mon Sep 17 00:00:00 2001 From: marco-ippolito Date: Mon, 29 Apr 2024 10:44:34 +0200 Subject: [PATCH] util: move util.isSymbol 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 | 25 ------------------------- lib/util.js | 12 ------------ test/parallel/test-util.js | 4 ---- 4 files changed, 5 insertions(+), 44 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 3b26ca8cc44eaa..8becf526a20d09 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1304,6 +1304,9 @@ The `util.isString()` API has been removed. Please use -Type: Runtime +Type: End-of-Life -The [`util.isSymbol()`][] API is deprecated. Please use +The `util.isSymbol()` API has been removed. Please use `typeof arg === 'symbol'` instead. ### DEP0058: `util.isUndefined()` @@ -3799,7 +3802,6 @@ is deprecated to better align with recommendations per [NIST SP 800-38D][]. [`util.isObject()`]: util.md#utilisobjectobject [`util.isPrimitive()`]: util.md#utilisprimitiveobject [`util.isRegExp()`]: util.md#utilisregexpobject -[`util.isSymbol()`]: util.md#utilissymbolobject [`util.isUndefined()`]: util.md#utilisundefinedobject [`util.log()`]: util.md#utillogstring [`util.promisify`]: util.md#utilpromisifyoriginal diff --git a/doc/api/util.md b/doc/api/util.md index 05c803c7a66b27..b5c8f7d2cad927 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -3140,31 +3140,6 @@ util.isRegExp({}); // Returns: false ``` -### `util.isSymbol(object)` - - - -> Stability: 0 - Deprecated: Use `typeof value === 'symbol'` instead. - -* `object` {any} -* Returns: {boolean} - -Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. - -```js -const util = require('node:util'); - -util.isSymbol(5); -// Returns: false -util.isSymbol('foo'); -// Returns: false -util.isSymbol(Symbol('foo')); -// Returns: true -``` - ### `util.isUndefined(object)`