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

Refactor InterfaceType to support partial at the property level #93

Closed
untio11 opened this issue Jul 1, 2024 · 0 comments · Fixed by #96
Closed

Refactor InterfaceType to support partial at the property level #93

untio11 opened this issue Jul 1, 2024 · 0 comments · Fixed by #96
Assignees

Comments

@untio11
Copy link
Contributor

untio11 commented Jul 1, 2024

From review comment:

I think we should consider refactoring InterfaceType to support that as well. All the ingredients are already in place. This could have the following benefits: (I haven't tried it though)

  • No more need for a seperate PickType, we can now delegate entirely to InterfaceType (sometimes combined with a UnionType when the input type is a union) from within the pick function
  • withOptional then returns an InterfaceType instead of an IntersectionType makes sense I guess?1
  • we can support config options like strictMissingKeys etc
    If we decide to do that, we should do so in another branch. Let's discuss that offline.

Footnotes

  1. Currently, objects with both mandatory and optional properties are implemented as an intersection of one object with the mandatory properties and one object with the optional properties.

@pavadeli pavadeli self-assigned this Oct 8, 2024
@pavadeli pavadeli linked a pull request Oct 8, 2024 that will close 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 a pull request may close this issue.

2 participants