FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

stream: use validateObject for zlib/iter params by greenheadHQ · Pull Request #65015 · nodejs/node · GitHub

/ node Public

stream: use validateObject for zlib/iter params - #65015

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
greenheadHQ:transform-validate-object
Aug 17, 2026
Merged

stream: use validateObject for zlib/iter params#65015
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
greenheadHQ:transform-validate-object

Conversation

Copy link
Copy Markdown
Contributor

Replace the open-coded object check in validateParams() with validateObject using the kValidateObjectAllowArray flag. The flag matches the previous typeof params !== 'object' || params === null semantics case by case: arrays keep passing, null and other primitives keep rejecting. Both paths construct ERR_INVALID_ARG_TYPE with identical arguments, so the error type, code, and message are unchanged.

The added test locks the array-accepting boundary, which was not covered by the existing validation tests, and passes with and without the lib change.

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Aug 4, 2026
The kValidateObjectAllowArray flag matches the replaced check: arrays
keep passing and the thrown error is unchanged.

Signed-off-by: greenhead <shren0812@gmail.com>
greenheadHQ force-pushed the transform-validate-object branch from 23fcacd to 163140a Compare August 4, 2026 14:16

codecov Bot commented Aug 4, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.28%. Comparing base (31cde9f) to head (163140a).
⚠️ Report is 205 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65015      +/-   ##
==========================================
- Coverage   90.30%   90.28%   -0.02%     
==========================================
  Files         759      759              
  Lines      247621   247633      +12     
  Branches    46672    46688      +16     
==========================================
- Hits       223603   223585      -18     
- Misses      15473    15515      +42     
+ Partials     8545     8533      -12     
Files with missing lines Coverage Δ
lib/internal/streams/iter/transform.js 95.72% <100.00%> (-0.01%) ⬇️

... and 38 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor Author

@nodejs/streams Could someone take a look at this? It swaps an open-coded object check in validateParams() for the existing validateObject helper, keeping the same error via kValidateObjectAllowArray. CI is green.

Copy link
Copy Markdown
Contributor Author

@jasnell You wrote stream/iter, so you may be the right person to look at this one. It's a small refactor of the options.params check, with the array-accepting behaviour preserved.

jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 14, 2026
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 14, 2026

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor Author

@jasnell Thanks for reviewing and approving this!

The failures in CI #75831 appear unrelated to this change. The Node.js reliability report records the same failures across multiple unrelated PRs:

  • ffi/test-ffi-fast-integer-validation
  • parallel/test-stream-pipeline-http2
  • test-runner/test-run-watch-cwd-isolation-none-argv

https://github.com/nodejs/reliability/blob/main/reports/2026-08-15.md

Would you mind resuming the top-level CI job when you have a chance?

https://ci.nodejs.org/job/node-test-pull-request/75831/

Copy link
Copy Markdown
Collaborator

daeyeon added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Aug 17, 2026
jasnell added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 17, 2026
nodejs-github-bot merged commit 1dacb39 into nodejs:main Aug 17, 2026
75 of 76 checks passed

Copy link
Copy Markdown
Collaborator

Landed in 1dacb39

nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 17, 2026
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
The kValidateObjectAllowArray flag matches the replaced check: arrays
keep passing and the thrown error is unchanged.

Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: #65015
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
The kValidateObjectAllowArray flag matches the replaced check: arrays
keep passing and the thrown error is unchanged.

Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: #65015
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 outstanding review comments, and a CI started. needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL