Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zlib: set zlib.bytesRead end-of-life #55020

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2290,6 +2290,9 @@ core and obsoleted by the removal of NPN (Next Protocol Negotiation) support.

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/55020
description: End-of-Life.
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/23308
description: Runtime deprecation.
Expand All @@ -2298,7 +2301,7 @@ changes:
description: Documentation-only deprecation.
-->

Type: Runtime
Type: End-of-Life

Deprecated alias for [`zlib.bytesWritten`][]. This original name was chosen
because it also made sense to interpret the value as the number of bytes
Expand Down
17 changes: 0 additions & 17 deletions doc/api/zlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -684,22 +684,6 @@ base class of the compressor/decompressor classes.
This class inherits from [`stream.Transform`][], allowing `node:zlib` objects to
be used in pipes and similar stream operations.

### `zlib.bytesRead`

<!-- YAML
added: v8.1.0
deprecated: v10.0.0
-->

> Stability: 0 - Deprecated: Use [`zlib.bytesWritten`][] instead.

* {number}

Deprecated alias for [`zlib.bytesWritten`][]. This original name was chosen
because it also made sense to interpret the value as the number of bytes
read by the engine, but is inconsistent with other streams in Node.js that
expose values under these names.

### `zlib.bytesWritten`

<!-- YAML
Expand Down Expand Up @@ -1307,7 +1291,6 @@ Decompress a chunk of data with [`Unzip`][].
[`buffer.kMaxLength`]: buffer.md#bufferkmaxlength
[`deflateInit2` and `inflateInit2`]: https://zlib.net/manual.html#Advanced
[`stream.Transform`]: stream.md#class-streamtransform
[`zlib.bytesWritten`]: #zlibbyteswritten
[convenience methods]: #convenience-methods
[zlib documentation]: https://zlib.net/manual.html#Constants
[zlib.createGzip example]: #zlib
21 changes: 0 additions & 21 deletions lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ const {
genericNodeError,
} = require('internal/errors');
const { Transform, finished } = require('stream');
const {
deprecate,
} = require('internal/util');
const {
isArrayBufferView,
isAnyArrayBuffer,
Expand Down Expand Up @@ -271,24 +268,6 @@ ObjectDefineProperty(ZlibBase.prototype, '_closed', {
},
});

// `bytesRead` made sense as a name when looking from the zlib engine's
// perspective, but it is inconsistent with all other streams exposed by Node.js
// that have this concept, where it stands for the number of bytes read
// *from* the stream (that is, net.Socket/tls.Socket & file system streams).
ObjectDefineProperty(ZlibBase.prototype, 'bytesRead', {
__proto__: null,
configurable: true,
enumerable: true,
get: deprecate(function() {
return this.bytesWritten;
}, 'zlib.bytesRead is deprecated and will change its meaning in the ' +
'future. Use zlib.bytesWritten instead.', 'DEP0108'),
set: deprecate(function(value) {
this.bytesWritten = value;
}, 'Setting zlib.bytesRead is deprecated. ' +
'This feature will be removed in the future.', 'DEP0108'),
});

/**
* @this ZlibBase
* @returns {void}
Expand Down
102 changes: 0 additions & 102 deletions test/parallel/test-zlib-bytes-read.js

This file was deleted.

Loading