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

@@ -1079,6 +1079,10 @@ Type: End-of-Life

10791079

The `util.isDate()` API has been removed. Please use

10801080

`arg instanceof Date` instead.

108110811082+

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()`

1083108710841088

<!-- YAML

@@ -1103,9 +1107,7 @@ changes:

1103110711041108

Type: End-of-Life

110511091106-

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)`.

1109111111101112

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

11111113

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

1266126812671269

Type: End-of-Life

126812701269-

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.

1272127212731273

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

12741274