Skip to content

Reduce min(), max() and clamp() with number arguments#1131

Merged
devongovett merged 1 commit intoparcel-bundler:masterfrom
yisibl:reduce-comp-func
Jan 20, 2026
Merged

Reduce min(), max() and clamp() with number arguments#1131
devongovett merged 1 commit intoparcel-bundler:masterfrom
yisibl:reduce-comp-func

Conversation

@yisibl
Copy link
Contributor

@yisibl yisibl commented Jan 13, 2026

  • Add support for Calc::Number in reduce_args to simplify min()/max()/clamp() with plain number arguments (e.g., min(1, 2, 3) => min(1, 2))
  • Extend clamp() parsing to handle Number comparisons (e.g., clamp(0, 255, 300) => 255)

Fixed: #1044, #1129

@yisibl
Copy link
Contributor Author

yisibl commented Jan 13, 2026

@devongovett When you have time, please take a look. After this merge, I plan to implement calc() in Integer.

- Add support for `Calc::Number` in reduce_args to simplify `min()/max()/clamp()`
  with plain number arguments (e.g., `min(1, 2, 3) => min(1, 2)`)
- Extend clamp() parsing to handle Number comparisons (e.g.,
  `clamp(0, 255, 300) => 255`)

Fixed: parcel-bundler#1044, parcel-bundler#1129
@devongovett devongovett merged commit 9cff098 into parcel-bundler:master Jan 20, 2026
3 checks passed
@yisibl yisibl deleted the reduce-comp-func branch January 20, 2026 04:34
@yisibl yisibl mentioned this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Unreachable executed" error when encountering min/max with unitless numbers

2 participants