From 72240942ed960380a774209e96c3dd0c798bd0f0 Mon Sep 17 00:00:00 2001 From: marco-ippolito Date: Mon, 29 Apr 2024 11:27:11 +0200 Subject: [PATCH] util: move util.isFunction 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 | 7 +++++-- doc/api/util.md | 29 ----------------------------- lib/util.js | 12 ------------ test/parallel/test-util.js | 5 ----- 4 files changed, 5 insertions(+), 48 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 48d018fc6df..3718bddafe7 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1105,6 +1105,9 @@ instead. -Type: Runtime +Type: End-of-Life -The [`util.isFunction()`][] API is deprecated. Please use +The `util.isFunction()` API has been removed. Please use `typeof arg === 'function'` instead. ### DEP0050: `util.isNull()` diff --git a/doc/api/util.md b/doc/api/util.md index 2635a60d878..da0a31256a7 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -2950,35 +2950,6 @@ util.isArray({}); // Returns: false ``` -### `util.isFunction(object)` - - - -> Stability: 0 - Deprecated: Use `typeof value === 'function'` instead. - -* `object` {any} -* Returns: {boolean} - -Returns `true` if the given `object` is a `Function`. Otherwise, returns -`false`. - -```js -const util = require('node:util'); - -function Foo() {} -const Bar = () => {}; - -util.isFunction({}); -// Returns: false -util.isFunction(Foo); -// Returns: true -util.isFunction(Bar); -// Returns: true -``` - ### `util.isPrimitive(object)`