Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
mattphillips wants to merge 1 commit into main
base: main
Choose a base branch
Loading
from mp/ts-defs
Draft

WIP: Add better type definitions #88

mattphillips wants to merge 1 commit into main from mp/ts-defs

Conversation

Copy link
Owner

@mattphillips mattphillips commented Nov 12, 2022

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 to never. 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 as undefined. Arrays can also have been deleted from so they should be kept in the types but made optional dictionaries.
  • updated: TODO

Copy link

codecov-commenter commented Nov 12, 2022
edited
Loading

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /