-
-
Notifications
You must be signed in to change notification settings - Fork 96
WIP: Add better type definitions #88
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
Codecov Report
All modified and coverable lines are covered by tests ✅
Project coverage is 100.00%. Comparing base (
e37b759
) to head (8a8138f
).
Report is 3 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@ ## main #88 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 7 7 Lines 109 109 Branches 36 36 ========================================= Hits 109 109
☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.
This is a bit of a POC to add type definitions for each diff function that works correctly.
I've not exhaustively tested this yet so don't know if it covers all cases but the general idea is as follows:
diff
: Merge the left hand side and right hand side types into optionals at all levels and convert arrays to dictionaries (recursing on the inferred array element type)added
: Keep all new RHS keys and set all old LHS keys tonever
. All new new at any level should not be optional. Arrays can also have been inserted into so they should be kept in the types but made optional dictionaries.deleted
: Keep all keys that are not present on the RHS keys but exist in the LHS asundefined
. Arrays can also have been deleted from so they should be kept in the types but made optional dictionaries.updated
: TODO