Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| }, | ||
| width: props.width, | ||
| height: props.height, | ||
| ccw_rotation: ccw_rotation || undefined, |
There was a problem hiding this comment.
Critical Bug: Zero rotation will be stored as undefined
The expression ccw_rotation || undefined will incorrectly evaluate to undefined when ccw_rotation is 0 (zero degrees). This is because 0 is a falsy value in JavaScript.
Impact: Components with 0° rotation will have their rotation stored as undefined instead of 0, potentially breaking rotation-dependent logic elsewhere in the codebase.
Fix: Either remove the || undefined entirely, or use a proper nullish check:
ccw_rotation: ccw_rotation ?? undefined,or simply:
ccw_rotation: ccw_rotation,| ccw_rotation: ccw_rotation || undefined, | |
| ccw_rotation: ccw_rotation, |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
No description provided.