From 708f57ea49a6e1f7df6e70a064b9fafc39a6fa9f Mon Sep 17 00:00:00 2001 From: marco-ippolito Date: Mon, 29 Apr 2024 10:41:03 +0200 Subject: [PATCH] util: move util.isNumber 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 | 12 ------------ test/parallel/test-util.js | 4 ---- 4 files changed, 5 insertions(+), 46 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index f99a5bce4b358b..315ba4a44ac41d 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1177,6 +1177,9 @@ The `util.isNullOrUndefined()` API has been removed. Please use -Type: Runtime +Type: End-of-Life -The [`util.isNumber()`][] API is deprecated. Please use +The `util.isNumber()` API has been removed. Please use `typeof arg === 'number'` instead. ### DEP0053: `util.isObject()` @@ -3790,7 +3793,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.isNumber()`]: util.md#utilisnumberobject [`util.isObject()`]: util.md#utilisobjectobject [`util.isPrimitive()`]: util.md#utilisprimitiveobject [`util.isRegExp()`]: util.md#utilisregexpobject diff --git a/doc/api/util.md b/doc/api/util.md index a942c2447a11f4..8798e39e1de80b 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -3045,33 +3045,6 @@ util.isFunction(Bar); // Returns: true ``` -### `util.isNumber(object)` - - - -> Stability: 0 - Deprecated: Use `typeof value === 'number'` instead. - -* `object` {any} -* Returns: {boolean} - -Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. - -```js -const util = require('node:util'); - -util.isNumber(false); -// Returns: false -util.isNumber(Infinity); -// Returns: true -util.isNumber(0); -// Returns: true -util.isNumber(NaN); -// Returns: true -``` - ### `util.isObject(object)`