diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index f7336ae19da623..bdc70aa4545249 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1198,6 +1198,9 @@ The [`util.isObject()`][] API is deprecated. -Type: Documentation-only +Type: Runtime The [`util.isPrimitive()`][] API is deprecated. diff --git a/lib/util.js b/lib/util.js index eca8ecb980e7a4..fbcacfa8228655 100644 --- a/lib/util.js +++ b/lib/util.js @@ -441,7 +441,11 @@ module.exports = { isFunction: deprecate(isFunction, 'The `util.isFunction` API is deprecated. Please use `typeof arg === "function"` instead.', 'DEP0049'), - isPrimitive: deprecate(isPrimitive, 'The `util.isPrimitive API is deprecated.', 'DEP0054'), + isPrimitive: deprecate(isPrimitive, + 'The `util.isPrimitive` API is deprecated. ' + + 'Please use `arg === null || ' + + '(typeof arg !== "object" && typeof arg !== "function")` instead.', + 'DEP0054'), log: deprecate(log, 'The `util.log API is deprecated.', 'DEP0059'), promisify, stripVTControlCharacters,