Skip to content

Commit e0b8de7

Browse files
marco-ippolitonodejs-github-bot
authored andcommitted
util: runtime deprecate util.isPrimitive
PR-URL: #50488 Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 5478e11 commit e0b8de7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

doc/api/deprecations.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,9 @@ The [`util.isObject()`][] API is deprecated.
11981198

11991199
<!-- YAML
12001200
changes:
1201+
- version: REPLACEME
1202+
pr-url: https://github.com/nodejs/node/pull/50488
1203+
description: Runtime deprecation.
12011204
- version:
12021205
- v6.12.0
12031206
- v4.8.6
@@ -1210,7 +1213,7 @@ changes:
12101213
description: Documentation-only deprecation.
12111214
-->
12121215

1213-
Type: Documentation-only
1216+
Type: Runtime
12141217

12151218
The [`util.isPrimitive()`][] API is deprecated.
12161219

lib/util.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,11 @@ module.exports = {
441441
isFunction: deprecate(isFunction,
442442
'The `util.isFunction` API is deprecated. Please use `typeof arg === "function"` instead.',
443443
'DEP0049'),
444-
isPrimitive: deprecate(isPrimitive, 'The `util.isPrimitive API is deprecated.', 'DEP0054'),
444+
isPrimitive: deprecate(isPrimitive,
445+
'The `util.isPrimitive` API is deprecated. ' +
446+
'Please use `arg === null || ' +
447+
'(typeof arg !== "object" && typeof arg !== "function")` instead.',
448+
'DEP0054'),
445449
log: deprecate(log, 'The `util.log API is deprecated.', 'DEP0059'),
446450
promisify,
447451
stripVTControlCharacters,

0 commit comments

Comments
 (0)