util: runtime deprecation util.isBuffer

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Marco Ippolito 2023-10-31 12:43:12 +02:00 committed by Node.js GitHub Bot
parent c17a448ca9
commit 3c670cb15d
2 changed files with 7 additions and 2 deletions

View File

@ -1011,6 +1011,9 @@ The [`util.isBoolean()`][] API is deprecated.
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
@ -1023,7 +1026,7 @@ changes:
description: Documentation-only deprecation.
-->
Type: Documentation-only
Type: Runtime
The [`util.isBuffer()`][] API is deprecated. Please use
[`Buffer.isBuffer()`][] instead.

View File

@ -394,7 +394,9 @@ module.exports = {
isBoolean: deprecate(isBoolean,
'The `util.isBoolean` API is deprecated. Please use `typeof arg === "boolean"` instead.',
'DEP0045'),
isBuffer: deprecate(isBuffer, 'The `util.isBuffer API is deprecated.', 'DEP0046'),
isBuffer: deprecate(isBuffer,
'The `util.isBuffer` API is deprecated. Please use `Buffer.isBuffer()` instead.',
'DEP0046'),
isDeepStrictEqual(a, b) {
if (internalDeepEqual === undefined) {
internalDeepEqual = require('internal/util/comparisons')