From 832a77c003abc99452db9587481b427d0e9280e3 Mon Sep 17 00:00:00 2001 From: marco-ippolito Date: Mon, 29 Apr 2024 10:43:01 +0200 Subject: [PATCH] util: move util.isString 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 | 27 --------------------------- lib/util.js | 11 ----------- test/parallel/test-util.js | 4 ---- 4 files changed, 5 insertions(+), 45 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 315ba4a44ac41d..3b26ca8cc44eaa 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1277,6 +1277,9 @@ The [`util.isRegExp()`][] API is deprecated. Please use -Type: Runtime +Type: End-of-Life -The [`util.isString()`][] API is deprecated. Please use +The `util.isString()` API has been removed. Please use `typeof arg === 'string'` instead. ### DEP0057: `util.isSymbol()` @@ -3796,7 +3799,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.isString()`]: util.md#utilisstringobject [`util.isSymbol()`]: util.md#utilissymbolobject [`util.isUndefined()`]: util.md#utilisundefinedobject [`util.log()`]: util.md#utillogstring diff --git a/doc/api/util.md b/doc/api/util.md index 8798e39e1de80b..05c803c7a66b27 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -3140,33 +3140,6 @@ util.isRegExp({}); // Returns: false ``` -### `util.isString(object)` - - - -> Stability: 0 - Deprecated: Use `typeof value === 'string'` instead. - -* `object` {any} -* Returns: {boolean} - -Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. - -```js -const util = require('node:util'); - -util.isString(''); -// Returns: true -util.isString('foo'); -// Returns: true -util.isString(String('foo')); -// Returns: true -util.isString(5); -// Returns: false -``` - ### `util.isSymbol(object)`