-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat: add isModelStatic
, isSameInitialModel
#14360
Conversation
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.
Nice utility function to add. Do have a few remarks
Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
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.
Final remark and then we're good to go
Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
🎉 This PR is included in version 7.0.0-alpha.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* feat: add isModelStatic, isSameInitialModel * docs: rework isSameInitialModel docs * Update test/unit/utils/model-utils.test.ts Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com> * Update test/unit/utils/model-utils.test.ts Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com> Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
Pull Request Checklist
yarn test
oryarn test-DIALECT
pass with this change (including linting)?Description Of Change
This PR adds two new utility methods:
isModelStatic
: returns true if the value is a subclass (not instance) of modelisSameInitialModel
: returns true if two models are variants of the same modelBoth were initially created for #14280, but this PR also refactors the existing codebase to use them where it makes sense