Skip to content

Commit

Permalink
util: move util.isUndefined to eol
Browse files Browse the repository at this point in the history
PR-URL: #52744
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
marco-ippolito authored and nodejs-github-bot committed May 6, 2024
1 parent 05e72c9 commit a59c7ae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 46 deletions.
8 changes: 5 additions & 3 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,9 @@ The `util.isSymbol()` API has been removed. Please use

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/52744
description: End-of-Life deprecation.
- version: v22.0.0
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
Expand All @@ -1346,9 +1349,9 @@ changes:
description: Documentation-only deprecation.
-->

Type: Runtime
Type: End-of-Life

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

### DEP0059: `util.log()`
Expand Down Expand Up @@ -3802,7 +3805,6 @@ is deprecated to better align with recommendations per [NIST SP 800-38D][].
[`util.isObject()`]: util.md#utilisobjectobject
[`util.isPrimitive()`]: util.md#utilisprimitiveobject
[`util.isRegExp()`]: util.md#utilisregexpobject
[`util.isUndefined()`]: util.md#utilisundefinedobject
[`util.log()`]: util.md#utillogstring
[`util.promisify`]: util.md#utilpromisifyoriginal
[`util.toUSVString()`]: util.md#utiltousvstringstring
Expand Down
26 changes: 0 additions & 26 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -3140,32 +3140,6 @@ util.isRegExp({});
// Returns: false
```
### `util.isUndefined(object)`
<!-- YAML
added: v0.11.5
deprecated: v4.0.0
-->
> Stability: 0 - Deprecated: Use `value === undefined` instead.
* `object` {any}
* Returns: {boolean}
Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`.
```js
const util = require('node:util');

const foo = undefined;
util.isUndefined(5);
// Returns: false
util.isUndefined(foo);
// Returns: true
util.isUndefined(null);
// Returns: false
```
### `util.log(string)`
<!-- YAML
Expand Down
12 changes: 0 additions & 12 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,6 @@ function lazyAbortController() {

let internalDeepEqual;

/**
* @deprecated since v4.0.0
* @param {any} arg
* @returns {arg is undefined}
*/
function isUndefined(arg) {
return arg === undefined;
}

/**
* @deprecated since v4.0.0
* @param {any} arg
Expand Down Expand Up @@ -372,9 +363,6 @@ module.exports = {
}
return internalDeepEqual(a, b);
},
isUndefined: deprecate(isUndefined,
'The `util.isUndefined` API is deprecated. Please use `arg === undefined` instead.',
'DEP0058'),
isRegExp: deprecate(types.isRegExp,
'The `util.isRegExp` API is deprecated. Please use `arg instanceof RegExp` instead.',
'DEP0055'),
Expand Down
5 changes: 0 additions & 5 deletions test/parallel/test-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ assert.strictEqual(util.isPrimitive(Infinity), true);
assert.strictEqual(util.isPrimitive(NaN), true);
assert.strictEqual(util.isPrimitive(Symbol('symbol')), true);

assert.strictEqual(util.isUndefined(undefined), true);
assert.strictEqual(util.isUndefined(), true);
assert.strictEqual(util.isUndefined(null), false);
assert.strictEqual(util.isUndefined('string'), false);

assert.strictEqual(util.isFunction(() => {}), true);
assert.strictEqual(util.isFunction(function() {}), true);
assert.strictEqual(util.isFunction(), false);
Expand Down

0 comments on commit a59c7ae

Please sign in to comment.