diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 4b47665d3e6f82..f7336ae19da623 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1175,6 +1175,9 @@ The [`util.isNumber()`][] API is deprecated. -Type: Documentation-only +Type: Runtime The [`util.isObject()`][] API is deprecated. diff --git a/lib/util.js b/lib/util.js index 00b132934d9b32..eca8ecb980e7a4 100644 --- a/lib/util.js +++ b/lib/util.js @@ -427,7 +427,8 @@ module.exports = { 'The `util.isRegExp` API is deprecated. Please use `arg instanceof RegExp` instead.', 'DEP0055'), isObject: deprecate(isObject, - 'The `util.isObject` API is deprecated. Please use `typeof arg === "object"` instead.', + 'The `util.isObject` API is deprecated. ' + + 'Please use `arg !== null && typeof arg === "object"` instead.', 'DEP0053'), isDate: deprecate(types.isDate, 'The `util.isDate API is deprecated. Please use `arg instanceof Error` instead.',