GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: update migration recomendations for `util.is**()` deprecations · nodejs/node@3276bfa

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • deprecations.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/deprecations.md‎

Copy file name to clipboardExpand all lines: doc/api/deprecations.md
+6-6Lines changed: 6 additions & 6 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,10 @@ Type: End-of-Life
10791079
The `util.isDate()` API has been removed. Please use
10801080
`arg instanceof Date` instead.
10811081

1082+
Also for stronger approaches, consider using:
1083+
`Date.prototype.toString.call(arg) === '[object Date]' && !isNaN(arg)`.
1084+
This can also be used in a `try/catch` block to handle invalid date objects.
1085+
10821086
### DEP0048: `util.isError()`
10831087

10841088
<!-- YAML
@@ -1103,9 +1107,7 @@ changes:
11031107

11041108
Type: End-of-Life
11051109

1106-
The `util.isError()` API has been removed. Please use
1107-
`Object.prototype.toString(arg) === '[object Error]' || arg instanceof Error`
1108-
instead.
1110+
The `util.isError()` API has been removed. Please use `Error.isError(arg)`.
11091111

11101112
### DEP0049: `util.isFunction()`
11111113

@@ -1266,9 +1268,7 @@ changes:
12661268

12671269
Type: End-of-Life
12681270

1269-
The `util.isPrimitive()` API has been removed. Please use
1270-
`arg === null || (typeof arg !=='object' && typeof arg !== 'function')`
1271-
instead.
1271+
The `util.isPrimitive()` API has been removed. Please use `Object(arg) !== arg` instead.
12721272

12731273
### DEP0055: `util.isRegExp()`
12741274

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.