Skip to content
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

WIP: Add better type definitions #88

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

WIP: Add better type definitions #88

wants to merge 1 commit into from

Conversation

mattphillips
Copy link
Owner

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

@codecov-commenter
Copy link

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (8a8138f) compared to base (e37b759).
Patch has no changes to coverable lines.

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           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants