{{ message }}
refactor(type)!: make DIRECTION_MASK read-only#803
Merged
Conversation
There was a problem hiding this comment.
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Notes
Covers #378
Summary by CodeRabbit
Documentation
Refactor