Skip to content

Commit 60155da

Browse files
doc: deprecate utilisNativeError in favor of ErrorisError
PR-URL: #58262 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Edy Silva <[email protected]>
1 parent 3b111eb commit 60155da

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

doc/api/deprecations.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4016,6 +4016,20 @@ To make [`child_process.exec`][] invoke the default shell, either omit the
40164016
`shell` option, or set it to a nullish value. If the intention is not to invoke
40174017
a shell, use [`child_process.execFile`][] instead.
40184018

4019+
### DEP0197: `util.types.isNativeError()`
4020+
4021+
<!-- YAML
4022+
changes:
4023+
- version:
4024+
- REPLACEME
4025+
pr-url: https://github.com/nodejs/node/pull/58262
4026+
description: Documentation-only deprecation.
4027+
-->
4028+
4029+
Type: Documentation-only
4030+
4031+
The [`util.types.isNativeError`][] API is deprecated. Please use [`Error.isError`][] instead.
4032+
40194033
[DEP0142]: #dep0142-repl_builtinlibs
40204034
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
40214035
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -4034,6 +4048,7 @@ a shell, use [`child_process.execFile`][] instead.
40344048
[`Buffer.isBuffer()`]: buffer.md#static-method-bufferisbufferobj
40354049
[`Cipheriv`]: crypto.md#class-cipheriv
40364050
[`Decipheriv`]: crypto.md#class-decipheriv
4051+
[`Error.isError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError
40374052
[`REPLServer.clearBufferedCommand()`]: repl.md#replserverclearbufferedcommand
40384053
[`ReadStream.open()`]: fs.md#class-fsreadstream
40394054
[`Server.getConnections()`]: net.md#servergetconnectionscallback
@@ -4146,6 +4161,7 @@ a shell, use [`child_process.execFile`][] instead.
41464161
[`util.isArray()`]: util.md#utilisarrayobject
41474162
[`util.promisify`]: util.md#utilpromisifyoriginal
41484163
[`util.toUSVString()`]: util.md#utiltousvstringstring
4164+
[`util.types.isNativeError`]: util.md#utiltypesisnativeerrorvalue
41494165
[`util.types`]: util.md#utiltypes
41504166
[`util`]: util.md
41514167
[`worker.exitedAfterDisconnect`]: cluster.md#workerexitedafterdisconnect

doc/api/util.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,8 +3328,14 @@ util.types.isModuleNamespaceObject(ns); // Returns true
33283328
33293329
<!-- YAML
33303330
added: v10.0.0
3331+
deprecated: REPLACEME
33313332
-->
33323333
3334+
> Stability: 0 - Deprecated: Use [`Error.isError`][] instead.
3335+
3336+
**Note:** As of Node.js v24, `Error.isError()` is currently slower than `util.types.isNativeError()`.
3337+
If performance is critical, consider benchmarking both in your environment.
3338+
33333339
* `value` {any}
33343340
* Returns: {boolean}
33353341
@@ -3716,6 +3722,7 @@ util.isArray({});
37163722
[`'warning'`]: process.md#event-warning
37173723
[`Array.isArray()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
37183724
[`ArrayBuffer.isView()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView
3725+
[`Error.isError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError
37193726
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
37203727
[`MIMEparams`]: #class-utilmimeparams
37213728
[`Object.assign()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign

0 commit comments

Comments
 (0)