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

Missing { info: true } support on node:zlib #2644

Closed
anonrig opened this issue Sep 3, 2024 · 0 comments · Fixed by #2691
Closed

Missing { info: true } support on node:zlib #2644

anonrig opened this issue Sep 3, 2024 · 0 comments · Fixed by #2691
Assignees
Labels
bug Something isn't working

Comments

@anonrig
Copy link
Member

anonrig commented Sep 3, 2024

We currently roll our own implementation for convenience methods that doesn't support {info:true} options.

Node.js implementation which lives under https://github.com/nodejs/node/blob/main/lib/zlib.js#L160 is as follows:

function zlibBufferOnEnd() {
  let buf;
  if (this.nread === 0) {
    buf = Buffer.alloc(0);
  } else {
    const bufs = this.buffers;
    buf = (bufs.length === 1 ? bufs[0] : Buffer.concat(bufs, this.nread));
  }
  this.close();
  if (this._info)
    this.cb(null, { buffer: buf, engine: this });
  else
    this.cb(null, buf);
}

We need to support this.info check for existing TODO tests to succeed.

@anonrig anonrig added the bug Something isn't working label Sep 3, 2024
@npaun npaun linked a pull request Sep 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants