fix: use svg pass-thru when requested format is svg - #262
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe ChangesSVG format resolution
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Guards the fix for unjs#261: requesting `f=svg`/`format=svg` on an SVG source must pass through instead of falling back to jpeg. Both cases fail without the fix. Also pins the surrounding behavior that is easy to regress in the format ternary: implicit pass-thru, rasterizing to another format, `f=svg` on a non-SVG source, and svgo script removal. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The svg branch always returns early, so it does not need to be threaded through `format`. Lifting the check above the ternary keeps the original two-level shape instead of three, and avoids implying that "svg" is a value sharp could ever receive in `toFormat()`. No behavior change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #262 +/- ##
==========================================
+ Coverage 75.00% 77.18% +2.18%
==========================================
Files 8 8
Lines 412 412
Branches 109 109
==========================================
+ Hits 309 318 +9
+ Misses 85 77 -8
+ Partials 18 17 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Resolves #261
Summary by CodeRabbit