Skip to content

Commit

Permalink
lib: runtime deprecate SlowBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS committed Sep 30, 2024
1 parent e49cf7a commit fd4ffe7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,9 @@ Type: End-of-Life

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/5833
description: Runtime deprecation.
- version: v6.12.0
pr-url: https://github.com/nodejs/node/pull/10116
description: A deprecation code has been assigned.
Expand All @@ -703,7 +706,7 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`SlowBuffer`][] class is deprecated. Please use
[`Buffer.allocUnsafeSlow(size)`][] instead.
Expand Down
6 changes: 5 additions & 1 deletion lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const {
kIsEncodingSymbol,
defineLazyProperties,
encodingsMap,
deprecate,
} = require('internal/util');
const {
isAnyArrayBuffer,
Expand Down Expand Up @@ -1322,7 +1323,10 @@ function isAscii(input) {

module.exports = {
Buffer,
SlowBuffer,
SlowBuffer: deprecate(
SlowBuffer,
'SlowBuffer() is deprecated. Please use Buffer.allowUnsafeSlow()',
'DEP0030'),
transcode,
isUtf8,
isAscii,
Expand Down

0 comments on commit fd4ffe7

Please sign in to comment.