-
-
Notifications
You must be signed in to change notification settings - Fork 445
fix(form-core): Only allow array deep keys in array methods #1495
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
This type will help with a lens API for forms so that only names leading to the subset data are allowed.
View your CI Pipeline Execution ↗ for commit 3d15d5d.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1495 +/- ##
=======================================
Coverage 89.13% 89.13%
=======================================
Files 31 31
Lines 1417 1417
Branches 362 362
=======================================
Hits 1263 1263
Misses 137 137
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a0247f4
to
95176b2
Compare
Not sure why it closed? It claims I did it, so it was unintentional. |
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.
That's brilliant, thank you!
This PR restricts array methods on the
FormApi
to only allow paths to array keys.Consider the following example:
What's the behaviour on v1.10?
With the setup given above, you can write the following commands:
What would change?
How does it work?
This implementation first determines
DeepKeys<T>
and then extracts the keys that are of the desired type. Therefore, it should not have a big impact on performance or have problems with future fixes toDeepKeys<T>