Skip to content

Commit 5478e11

Browse files
marco-ippolitonodejs-github-bot
authored andcommitted
util: runtime deprecate util.isObject
PR-URL: #50488 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent b05b1dd commit 5478e11

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,9 @@ The [`util.isNumber()`][] API is deprecated.
11751175

11761176
<!-- YAML
11771177
changes:
1178+
- version: REPLACEME
1179+
pr-url: https://github.com/nodejs/node/pull/50488
1180+
description: Runtime deprecation.
11781181
- version:
11791182
- v6.12.0
11801183
- v4.8.6
@@ -1187,7 +1190,7 @@ changes:
11871190
description: Documentation-only deprecation.
11881191
-->
11891192

1190-
Type: Documentation-only
1193+
Type: Runtime
11911194

11921195
The [`util.isObject()`][] API is deprecated.
11931196

lib/util.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ module.exports = {
427427
'The `util.isRegExp` API is deprecated. Please use `arg instanceof RegExp` instead.',
428428
'DEP0055'),
429429
isObject: deprecate(isObject,
430-
'The `util.isObject` API is deprecated. Please use `typeof arg === "object"` instead.',
430+
'The `util.isObject` API is deprecated. ' +
431+
'Please use `arg !== null && typeof arg === "object"` instead.',
431432
'DEP0053'),
432433
isDate: deprecate(types.isDate,
433434
'The `util.isDate API is deprecated. Please use `arg instanceof Error` instead.',

0 commit comments

Comments
 (0)