Skip to content

stream: use validateNumber for options.min - #65193

Open
ChocoChip0519 wants to merge 1 commit into
nodejs:mainfrom
ChocoChip0519:stream-use-validatenumber-for-options-min
Open

stream: use validateNumber for options.min#65193
ChocoChip0519 wants to merge 1 commit into
nodejs:mainfrom
ChocoChip0519:stream-use-validatenumber-for-options-min

Conversation

@ChocoChip0519

Copy link
Copy Markdown

This replaces the manual options.min type check in
ReadableStreamBYOBReader.read() with the shared validateNumber()
validator.

-    if (typeof min !== 'number')
-      throw new ERR_INVALID_ARG_TYPE('options.min', 'number', min);
+    validateNumber(min, 'options.min');

This preserves the existing error behavior while using the common validation
helper. It also adds coverage for non-number and valid numeric options.min values.

Signed-off-by: Taeuk Ha <tomcat0519@naver.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. web streams labels Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.31%. Comparing base (404b0cf) to head (5b2004a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65193      +/-   ##
==========================================
- Coverage   90.32%   90.31%   -0.02%     
==========================================
  Files         760      760              
  Lines      248525   248525              
  Branches    46894    46893       -1     
==========================================
- Hits       224488   224447      -41     
- Misses      15469    15511      +42     
+ Partials     8568     8567       -1     
Files with missing lines Coverage Δ
lib/internal/webstreams/readablestream.js 98.19% <100.00%> (+0.02%) ⬆️

... and 37 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants