-
Notifications
You must be signed in to change notification settings - Fork 199
refactor(type)!: make DIRECTION_MASK read-only #803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Warning Rate limit exceeded@tbouffard has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 47 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe changes update the Changes
Sequence Diagram(s)No sequence diagram is generated as the changes are limited to type-level immutability and documentation updates. ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/core/src/util/Constants.ts (1)
416-425: Proper Immutability at Type Level Achieved
The addition ofas constcorrectly enforces literal types and readonly properties forDIRECTION_MASKat compile time.Consider also applying
Object.freezeat runtime if you need to enforce immutability during execution:-export const DIRECTION_MASK = { +export const DIRECTION_MASK = Object.freeze({ /** No direction. */ NONE: 0, WEST: 1, NORTH: 2, SOUTH: 4, EAST: 8, /** All directions. */ ALL: 15, -} as const; +} as const);CHANGELOG.md (1)
26-26: Link Changelog Entry to Issue for Traceability
The new breaking change forconstants.DIRECTION_MASKis correctly documented. For better traceability, consider linking it to the related issue:- - `constants.DIRECTION_MASK` is now read-only (types only). + - `constants.DIRECTION_MASK` is now read-only (types only). See [#378](https://github.com/maxGraph/maxGraph/issues/378).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md(1 hunks)packages/core/src/util/Constants.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build (windows-2022)
|



Notes
Covers #378
Summary by CodeRabbit
Documentation
Refactor