fix: restore string modifier values in VArg#308
Conversation
`VArg` returned `undefined` for any value that isn't valid JSON, which broke every string-valued modifier (`s_40x40`, `fit_cover`, `pos_top`, `kernel_nearest`, hex backgrounds, etc.). The previous `destr`-based implementation fell back to the raw string in this case. Restore that fallback while keeping `"undefined"` mapped to `undefined`.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR modifies the ChangesVArg Argument Parsing Enhancement
Possibly related issues
Poem
🎯 2 (Simple) | ⏱️ ~5–10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
VArgreturnedundefinedfor any value that isn't valid JSON, since themodernize ts usagerefactor swappeddestrfor a bareJSON.parse. This silently broke every string-valued modifier:s_40x40/s_200x200(resize) → no resize appliedfit_cover,pos_top,kernel_nearestbackgroundcolorsJSON.parse("40x40")throws, soVArgreturnedundefined, andresizethen computed[NaN]for the dimensions and bailed out.Fix
Restore the
destr-style fallback to the raw string when the value isn't valid JSON, while keeping"undefined"mapped to actualundefined(relied on by the existing test).Test plan
pnpm test(54 passed, 9 skipped)/s_40x40/...now resizesSummary by CodeRabbit