Skip to content

Commit 984894b

Browse files
miguelmarcondesfaduh95
authored andcommitted
doc: deprecate utilisNativeError in favor of ErrorisError
PR-URL: #58262 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Jordan Harband <ljharb@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
1 parent 377ef3c commit 984894b

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
@@ -3983,6 +3983,20 @@ To make [`child_process.exec`][] invoke the default shell, either omit the
39833983
`shell` option, or set it to a nullish value. If the intention is not to invoke
39843984
a shell, use [`child_process.execFile`][] instead.
39853985

3986+
### DEP0197: `util.types.isNativeError()`
3987+
3988+
<!-- YAML
3989+
changes:
3990+
- version:
3991+
- REPLACEME
3992+
pr-url: https://github.com/nodejs/node/pull/58262
3993+
description: Documentation-only deprecation.
3994+
-->
3995+
3996+
Type: Documentation-only
3997+
3998+
The [`util.types.isNativeError`][] API is deprecated. Please use [`Error.isError`][] instead.
3999+
39864000
[DEP0142]: #dep0142-repl_builtinlibs
39874001
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
39884002
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -4001,6 +4015,7 @@ a shell, use [`child_process.execFile`][] instead.
40014015
[`Buffer.isBuffer()`]: buffer.md#static-method-bufferisbufferobj
40024016
[`Cipheriv`]: crypto.md#class-cipheriv
40034017
[`Decipheriv`]: crypto.md#class-decipheriv
4018+
[`Error.isError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError
40044019
[`REPLServer.clearBufferedCommand()`]: repl.md#replserverclearbufferedcommand
40054020
[`ReadStream.open()`]: fs.md#class-fsreadstream
40064021
[`Server.getConnections()`]: net.md#servergetconnectionscallback
@@ -4116,6 +4131,7 @@ a shell, use [`child_process.execFile`][] instead.
41164131
[`util.isArray()`]: util.md#utilisarrayobject
41174132
[`util.promisify`]: util.md#utilpromisifyoriginal
41184133
[`util.toUSVString()`]: util.md#utiltousvstringstring
4134+
[`util.types.isNativeError`]: util.md#utiltypesisnativeerrorvalue
41194135
[`util.types`]: util.md#utiltypes
41204136
[`util`]: util.md
41214137
[`worker.exitedAfterDisconnect`]: cluster.md#workerexitedafterdisconnect

doc/api/util.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3324,8 +3324,14 @@ util.types.isModuleNamespaceObject(ns); // Returns true
33243324
33253325
<!-- YAML
33263326
added: v10.0.0
3327+
deprecated: REPLACEME
33273328
-->
33283329
3330+
> Stability: 0 - Deprecated: Use [`Error.isError`][] instead.
3331+
3332+
**Note:** As of Node.js v24, `Error.isError()` is currently slower than `util.types.isNativeError()`.
3333+
If performance is critical, consider benchmarking both in your environment.
3334+
33293335
* `value` {any}
33303336
* Returns: {boolean}
33313337
@@ -3712,6 +3718,7 @@ util.isArray({});
37123718
[`'warning'`]: process.md#event-warning
37133719
[`Array.isArray()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
37143720
[`ArrayBuffer.isView()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView
3721+
[`Error.isError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError
37153722
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
37163723
[`MIMEparams`]: #class-utilmimeparams
37173724
[`Object.assign()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign

0 commit comments

Comments
 (0)