Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: move deprecated utils to runtime deprecation #50488

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 110 additions & 32 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,9 @@ The [`tls.SecurePair`][] class is deprecated. Please use

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -976,7 +979,7 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isArray()`][] API is deprecated. Please use `Array.isArray()`
instead.
Expand All @@ -985,6 +988,9 @@ instead.

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -997,14 +1003,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isBoolean()`][] API is deprecated.
The [`util.isBoolean()`][] API is deprecated. Please use
`typeof arg === 'boolean'` instead.

### DEP0046: `util.isBuffer()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1017,7 +1027,7 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isBuffer()`][] API is deprecated. Please use
[`Buffer.isBuffer()`][] instead.
Expand All @@ -1026,6 +1036,9 @@ The [`util.isBuffer()`][] API is deprecated. Please use

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1038,14 +1051,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isDate()`][] API is deprecated.
The [`util.isDate()`][] API is deprecated. Please use
`arg instanceof Date` instead.
marco-ippolito marked this conversation as resolved.
Show resolved Hide resolved
marco-ippolito marked this conversation as resolved.
Show resolved Hide resolved

### DEP0048: `util.isError()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1058,14 +1075,19 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isError()`][] API is deprecated.
The [`util.isError()`][] API is deprecated. Please use
`Object.prototype.toString(arg) === '[object Error]' || arg instanceof Error`
instead.

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

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1078,14 +1100,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isFunction()`][] API is deprecated.
The [`util.isFunction()`][] API is deprecated. Please use
`typeof arg === 'function'` instead.

### DEP0050: `util.isNull()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1098,14 +1124,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isNull()`][] API is deprecated.
The [`util.isNull()`][] API is deprecated. Please use
`arg === null` instead.

### DEP0051: `util.isNullOrUndefined()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1118,14 +1148,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isNullOrUndefined()`][] API is deprecated.
The [`util.isNullOrUndefined()`][] API is deprecated. Please use
`arg === null || arg === undefined` instead.

### DEP0052: `util.isNumber()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1138,14 +1172,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isNumber()`][] API is deprecated.
The [`util.isNumber()`][] API is deprecated. Please use
`typeof arg === 'number'` instead.

### DEP0053: `util.isObject()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1158,14 +1196,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isObject()`][] API is deprecated.
The [`util.isObject()`][] API is deprecated. Please use
`arg && typeof arg === 'object'` instead.

### DEP0054: `util.isPrimitive()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1178,14 +1220,19 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isPrimitive()`][] API is deprecated.
The [`util.isPrimitive()`][] API is deprecated. Please use
`arg === null || (typeof arg !=='object' && typeof arg !== 'function')`
instead.

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

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1198,14 +1245,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isRegExp()`][] API is deprecated.
The [`util.isRegExp()`][] API is deprecated. Please use
`arg instanceof RegExp` instead.

### DEP0056: `util.isString()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1218,14 +1269,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isString()`][] API is deprecated.
The [`util.isString()`][] API is deprecated. Please use
`typeof arg === 'string'` instead.

### DEP0057: `util.isSymbol()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1238,14 +1293,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isSymbol()`][] API is deprecated.
The [`util.isSymbol()`][] API is deprecated. Please use
`typeof arg === 'symbol'` instead.

### DEP0058: `util.isUndefined()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
Expand All @@ -1258,14 +1317,18 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.isUndefined()`][] API is deprecated.
The [`util.isUndefined()`][] API is deprecated. Please use
`arg === undefined` instead.

### DEP0059: `util.log()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version: v6.12.0
pr-url: https://github.com/nodejs/node/pull/10116
description: A deprecation code has been assigned.
Expand All @@ -1274,14 +1337,27 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util.log()`][] API has been deprecated because it's an unmaintained
legacy API that was exposed to user land by accident. Instead,
consider the following alternatives based on your specific needs:

* **Third-Party Logging Libraries**

* **Use `console.log(new Date().toLocaleString(), message)`**

The [`util.log()`][] API is deprecated.
By adopting one of these alternatives, you can transition away from `util.log()`
and choose a logging strategy that aligns with the specific
requirements and complexity of your application.

### DEP0060: `util._extend()`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version: v6.12.0
pr-url: https://github.com/nodejs/node/pull/10116
description: A deprecation code has been assigned.
Expand All @@ -1290,9 +1366,11 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`util._extend()`][] API is deprecated.
The [`util._extend()`][] API is deprecated because it's an unmaintained
legacy API that was exposed to user land by accident.
Please use `target = Object.assign(target, source)` instead.

### DEP0061: `fs.SyncWriteStream`

Expand Down
Loading