From b5cae4fea6a662027c483d2e7584304df87be708 Mon Sep 17 00:00:00 2001 From: marco-ippolito Date: Mon, 29 Apr 2024 11:10:00 +0200 Subject: [PATCH] util: move util.isDate 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 | 26 -------------------------- 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 a2448ea270a3bf..e71db997dc9a4f 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1050,6 +1050,9 @@ The `util.isBuffer()` API has been removed. Please use -Type: Runtime +Type: End-of-Life -The [`util.isDate()`][] API is deprecated. Please use +The `util.isDate()` API has been removed. Please use `arg instanceof Date` instead. ### DEP0048: `util.isError()` diff --git a/doc/api/util.md b/doc/api/util.md index 6fd5a824b43f8b..2da1963e59069b 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -2950,31 +2950,6 @@ util.isArray({}); // Returns: false ``` -### `util.isDate(object)` - - - -> Stability: 0 - Deprecated: Use [`util.types.isDate()`][] instead. - -* `object` {any} -* Returns: {boolean} - -Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. - -```js -const util = require('node:util'); - -util.isDate(new Date()); -// Returns: true -util.isDate(Date()); -// false (without 'new' returns a String) -util.isDate({}); -// Returns: false -``` - ### `util.isError(object)`