Skip to content

doc: add missing options.info for ZstdOptions #58360

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

Conversation

hkleungai
Copy link
Contributor

@hkleungai hkleungai commented May 16, 2025

Source code of class Zstd calls ctor of parent ZlibBase via
super()

By inspecting opts in ZlibBase ctor, we can see opts?.info is
further used to determine the return shapes of *Sync() methods in
children class. This information will need to be revealed in nodejs doc.

this._info = opts?.info;

This PR is separated from the one for BrotliOptions, since these two
changes potentially need to be backported to different minimum versions.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. zlib Issues and PRs related to the zlib subsystem. labels May 16, 2025
doc/api/zlib.md Outdated
@@ -1049,6 +1049,7 @@ Each Zstd-based class takes an `options` object. All options are optional.
* `params` {Object} Key-value object containing indexed [Zstd parameters][].
* `maxOutputLength` {integer} Limits output size when using
[convenience methods][]. **Default:** [`buffer.kMaxLength`][]
* `info` {boolean} (If `true`, returns an object with `buffer` and `engine`.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `info` {boolean} (If `true`, returns an object with `buffer` and `engine`.)
* `info` {boolean} If `true`, returns an object with `buffer` and `engine`. **Default:** `false`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also repushed #58359. Please help review.

Source code of `class Zstd` calls ctor of parent `ZlibBase` via
`super()`

By inspecting `opts` in `ZlibBase` ctor, we can see `opts?.info` is
further used to determine the return shapes of `*Sync()` methods in
children class. This information will need to be revealed in nodejs doc.

This PR is separated from the one for `BrotliOptions`, since these two
changes potentially need to be backported to different minimum versions.
@hkleungai hkleungai force-pushed the doc-api-zlib-add-missing-ZstdOptions.info branch from 9ba31de to 714ee55 Compare May 28, 2025 17:51
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels May 28, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 28, 2025
@nodejs-github-bot nodejs-github-bot merged commit d5345b6 into nodejs:main May 28, 2025
22 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in d5345b6

@hkleungai hkleungai deleted the doc-api-zlib-add-missing-ZstdOptions.info branch May 30, 2025 19:00
targos pushed a commit that referenced this pull request May 31, 2025
Source code of `class Zstd` calls ctor of parent `ZlibBase` via
`super()`

By inspecting `opts` in `ZlibBase` ctor, we can see `opts?.info` is
further used to determine the return shapes of `*Sync()` methods in
children class. This information will need to be revealed in nodejs doc.

This PR is separated from the one for `BrotliOptions`, since these two
changes potentially need to be backported to different minimum versions.

PR-URL: #58360
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request Jun 10, 2025
Source code of `class Zstd` calls ctor of parent `ZlibBase` via
`super()`

By inspecting `opts` in `ZlibBase` ctor, we can see `opts?.info` is
further used to determine the return shapes of `*Sync()` methods in
children class. This information will need to be revealed in nodejs doc.

This PR is separated from the one for `BrotliOptions`, since these two
changes potentially need to be backported to different minimum versions.

PR-URL: #58360
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. zlib Issues and PRs related to the zlib subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants