From d3068b9cfa5a44d673e824bdb38d75bf5d04d842 Mon Sep 17 00:00:00 2001 From: marco-ippolito Date: Mon, 29 Apr 2024 10:59:10 +0200 Subject: [PATCH] util: move util.isRegExp 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 | 3 --- test/parallel/test-util.js | 10 ---------- 4 files changed, 5 insertions(+), 41 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index bc12ed65b7e947..989e49408daa93 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1253,6 +1253,9 @@ instead. -Type: Runtime +Type: End-of-Life -The [`util.isRegExp()`][] API is deprecated. Please use +The `util.isRegExp()` API has been removed. Please use `arg instanceof RegExp` instead. ### DEP0056: `util.isString()` @@ -3804,7 +3807,6 @@ is deprecated to better align with recommendations per [NIST SP 800-38D][]. [`util.isFunction()`]: util.md#utilisfunctionobject [`util.isObject()`]: util.md#utilisobjectobject [`util.isPrimitive()`]: util.md#utilisprimitiveobject -[`util.isRegExp()`]: util.md#utilisregexpobject [`util.log()`]: util.md#utillogstring [`util.promisify`]: util.md#utilpromisifyoriginal [`util.toUSVString()`]: util.md#utiltousvstringstring diff --git a/doc/api/util.md b/doc/api/util.md index 1b2156ee927ce6..cbf56074bb9945 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -3115,31 +3115,6 @@ util.isPrimitive(new Date()); // Returns: false ``` -### `util.isRegExp(object)` - - - -> Stability: 0 - Deprecated - -* `object` {any} -* Returns: {boolean} - -Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. - -```js -const util = require('node:util'); - -util.isRegExp(/some regexp/); -// Returns: true -util.isRegExp(new RegExp('another regexp')); -// Returns: true -util.isRegExp({}); -// Returns: false -``` - ### `util.log(string)`