Fix: Enhance sanitizeRadius Function with NaN and Infinity Guards - #8877
Fix: Enhance sanitizeRadius Function with NaN and Infinity Guards#8877tmdeveloper007 wants to merge 1 commit into
Conversation
|
This pull request effectively extends the |
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
Nice work hardening the \sanitizeRadius\ utility in \lib/svg/sanitizer.ts. Adding \Number.isFinite()\ effectively protects against \Infinity\ values that could otherwise bypass the \isNaN\ check. I also appreciate the addition of \Math.round()\ before clamping to guarantee an integer output. Good job!
Summary of What Has Been Done
Extended
sanitizeRadiusto also check forInfinityvalues in addition toNaN. AddedMath.round()to ensure the returned value is always an integer.Changes Made
lib/svg/sanitizer.ts: AddedNumber.isFinite()check andMath.round()insanitizeRadiusImpact it Made
Closes #8845
Note: Please assign this PR to the
tmdeveloper007account.