Skip to content

Commit 8640001

Browse files
doc: remove deprecated util.isArray() function and update documentation
1 parent 2dc84c0 commit 8640001

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

doc/api/util.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,33 +3807,6 @@ Node.js modules. The community found and used it anyway.
38073807
It is deprecated and should not be used in new code. JavaScript comes with very
38083808
similar built-in functionality through [`Object.assign()`][].
38093809
3810-
### `util.isArray(object)`
3811-
3812-
<!-- YAML
3813-
added: v0.6.0
3814-
deprecated: v4.0.0
3815-
-->
3816-
3817-
> Stability: 0 - Deprecated: Use [`Array.isArray()`][] instead.
3818-
3819-
* `object` {any}
3820-
* Returns: {boolean}
3821-
3822-
Alias for [`Array.isArray()`][].
3823-
3824-
Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`.
3825-
3826-
```js
3827-
const util = require('node:util');
3828-
3829-
util.isArray([]);
3830-
// Returns: true
3831-
util.isArray(new Array());
3832-
// Returns: true
3833-
util.isArray({});
3834-
// Returns: false
3835-
```
3836-
38373810
An automated migration is available ([source](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is)):
38383811
38393812
```bash

lib/util.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,6 @@ module.exports = {
486486
getSystemErrorMessage,
487487
inherits,
488488
inspect,
489-
isArray: internalDeprecate(ArrayIsArray,
490-
'The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.',
491-
'DEP0044'),
492489
isDeepStrictEqual(a, b, skipPrototype) {
493490
if (internalDeepEqual === undefined) {
494491
internalDeepEqual = require('internal/util/comparisons').isDeepStrictEqual;

0 commit comments

Comments
 (0)